Support intra-segment search in the query profiler with per-slice and per-partition breakdowns#16417
Open
prudhvigodithi wants to merge 3 commits into
Open
Support intra-segment search in the query profiler with per-slice and per-partition breakdowns#16417prudhvigodithi wants to merge 3 commits into
prudhvigodithi wants to merge 3 commits into
Conversation
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
Signed-off-by: Prudhvi Godithi <pgodithi@amazon.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Building on intra-segment search concurrency (#13542) and concurrent-search profiling (#14413), this PR attributes query-profiler timings per slice and per partition, resolving the slice-identification problem left open in #14413's review. #14413 keys leaf breakdowns by
Thread, so when one thread runs several slices sequentially their timings merge into one bucket and for intra-segment search it cannot attribute timing to the doc-id-range partitions a segment is split into.Change
search(LeafReaderContextPartition[])seam, independent of thread.(sliceId, segmentOrd, minDocId, maxDocId), set atsearchLeaf(...); both overrides delegate tosuper(no duplicated search logic).threadId/threadName/startTimeshow how the search parallelized,Threadobject replaced by serializable id+nameSample output
Verified locally by adding a temporary
toString()(not included in this PR) and serializinggetProfileResult()for aBooleanQuery(+foo:bar foo:baz)over a single segment split into two partitions[0,100)/[100,200)on a 2-thread executor.[ { "type": "BooleanQuery", "description": "+foo:bar foo:baz", "breakdown": { "create_weight": 1634167, "create_weight_count": 1 }, "slices": [ { "slice_id": 0, "thread_id": 22, "thread_name": "search-worker-caller", "partitions": [ { "segment_ord": 0, "doc_range": [0, 100], "breakdown": { "build_scorer": 5185916, "next_doc_count": 101, "score_count": 100, "advance_count": 0 } } ] }, { "slice_id": 1, "thread_id": 23, "thread_name": "search-worker-pool-3-thread-1", "partitions": [ { "segment_ord": 0, "doc_range": [100, 200], "breakdown": { "build_scorer": 5183792, "next_doc_count": 100, "score_count": 100, "advance_count": 1 } } ] } ], "children": [ { "type": "TermQuery", "description": "foo:bar", "breakdown": { "create_weight": 903875, "create_weight_count": 1 }, "slices": [ { "slice_id": 0, "thread_id": 22, "thread_name": "search-worker-caller", "partitions": [ { "segment_ord": 0, "doc_range": [0, 100], "breakdown": { "build_scorer": 1026292, "next_doc_count": 101, "score_count": 100 } } ] }, { "slice_id": 1, "thread_id": 23, "thread_name": "search-worker-pool-3-thread-1", "partitions": [ { "segment_ord": 0, "doc_range": [100, 200], "breakdown": { "build_scorer": 1008001, "next_doc_count": 100, "score_count": 100 } } ] } ], "children": [] }, { "type": "TermQuery", "description": "foo:baz", "breakdown": { "create_weight": 52459, "create_weight_count": 1 }, "slices": [ { "slice_id": 0, "thread_id": 22, "thread_name": "search-worker-caller", "partitions": [ { "segment_ord": 0, "doc_range": [0, 100], "breakdown": { "build_scorer": 959, "next_doc_count": 0, "score_count": 0 } } ] }, { "slice_id": 1, "thread_id": 23, "thread_name": "search-worker-pool-3-thread-1", "partitions": [ { "segment_ord": 0, "doc_range": [100, 200], "breakdown": { "build_scorer": 708, "next_doc_count": 0, "score_count": 0 } } ] } ], "children": [] } ] } ]