Hello,
I am using the profile API to try and debug a slow query (3-7s). From what I can tell, the operation to build scorers for the geo_shapes in the query are particularly slow and nearly all of the query time is spent doing this.
Here's a snippet of the profiler output for a piece of the query where I see "build_scorer" occupying a lot of time:
{'type': 'IntersectsPrefixTreeQuery', 'description': 'IntersectsPrefixTreeQuery(fieldName=geometry,queryShape=POLYGON ((2.6367 37.5097, 10.6348 37.3702, 26.7188 33.9434, 25.4004 38.891, 29.4434 40.4469, 41.6602 49.2678, 28.2129 56.17, 32.168 70.2, 25.4004 71.7464, 17.1387 71.329, 1.4062 61.5227, -19.6875 68.4315, -31.0254 64.7741, -10.459 50.1769, -11.0742 35.7465, -2.9883 35.8891, 2.6367 37.5097)),detailLevel=18,prefixGridScanLevel=14)', 'time': '3.7s', 'time_in_nanos': 3781281199, 'breakdown': {'score': 0, 'build_scorer_count': 33, 'match_count': 0, 'create_weight': 962, 'next_doc': 7025, 'match': 0, 'create_weight_count': 1, 'next_doc_count': 4, 'score_count': 0, 'build_scorer': 3781241102, 'advance': 32042, 'advance_count': 30}}
Note that 3.7s just to build the scorer seems high. I'm looking for help to understand what is going on here. Any pointers to more information would be appreciated.
Cluster config:
ES 6.2.4
120 data nodes, 3 master
377 indices
4200 shards
~1.6B docs
Gist with query and response with profiling: https://gist.github.com/bdelliott/41ef120158ad2a0188303b2385ba6e23
Thanks,
Brian