[MOD-12263] Enhance FT.PROFILE with vector search execution details#7408
[MOD-12263] Enhance FT.PROFILE with vector search execution details#7408
Conversation
add VecSimSearchMode_ToString
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7408 +/- ##
==========================================
- Coverage 85.17% 84.90% -0.28%
==========================================
Files 346 346
Lines 53049 53239 +190
Branches 13773 13935 +162
==========================================
+ Hits 45184 45201 +17
- Misses 7671 7844 +173
Partials 194 194
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Bug: Iterator Rewind Corrupts Profile Statistics
The HR_Rewind function doesn't reset maxBatchSize and maxBatchIteration fields. When a hybrid iterator is rewound and executed again, these statistics retain values from the previous execution, causing incorrect profile output on subsequent runs. The fields should be reset to 0 along with numIterations.
src/iterators/hybrid_reader.c#L384-L405
RediSearch/src/iterators/hybrid_reader.c
Lines 384 to 405 in b4d094d
alonre24
left a comment
There was a problem hiding this comment.
Nice and clean :)
one comment
| # Check at least one shard has the expected search mode | ||
| # res['Profile']['Shards'][0]['Iterators profile']['Vector search mode'] |
There was a problem hiding this comment.
Why at least one shard and not all?
Also, can we validate the expected number of batches and max batch size (if relevant) here?
There was a problem hiding this comment.
This one is runing both in SA and in cluster so
- Since the heuristic depends on the number of documents (and their text content) it might be complicated to create it for a unified scenario for all shards
- im afraid that testing it will complicate the test. We test it in
testProfileVector, i don't think testing it here will add value
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.8
git worktree add -d .worktree/backport-7408-to-2.8 origin/2.8
cd .worktree/backport-7408-to-2.8
git switch --create backport-7408-to-2.8
git cherry-pick -x a43aacf782c0cd2ca57d9a797c4e8b690e7d7d72 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.10
git worktree add -d .worktree/backport-7408-to-2.10 origin/2.10
cd .worktree/backport-7408-to-2.10
git switch --create backport-7408-to-2.10
git cherry-pick -x a43aacf782c0cd2ca57d9a797c4e8b690e7d7d72 |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.2
git worktree add -d .worktree/backport-7408-to-8.2 origin/8.2
cd .worktree/backport-7408-to-8.2
git switch --create backport-7408-to-8.2
git cherry-pick -x a43aacf782c0cd2ca57d9a797c4e8b690e7d7d72 |
|
Successfully created backport PR for |
…ails (#7427) [MOD-12263] Enhance FT.PROFILE with vector search execution details (#7408) * add vector search mode to profule add VecSimSearchMode_ToString * ADD 'Largest batch size',and 'Largest batch iteration (zero based) * reset maxBatchSize and maxBatchIteration (cherry picked from commit a43aacf) Co-authored-by: meiravgri <[email protected]>
…ails (#7427) [MOD-12263] Enhance FT.PROFILE with vector search execution details (#7408) * add vector search mode to profule add VecSimSearchMode_ToString * ADD 'Largest batch size',and 'Largest batch iteration (zero based) * reset maxBatchSize and maxBatchIteration (cherry picked from commit a43aacf) Co-authored-by: meiravgri <[email protected]>
…7408) profile.c changes are in index.c
This PR enhances
FT.PROFILEoutput for vector queries by adding execution mode information and batch statistics.Vector Search Mode
All vector queries now report their execution mode in the profile output:
Modes:
STANDARD_KNN- Pure vector search without filtersHYBRID_ADHOC_BF- Ad-hoc brute force for filtered queriesHYBRID_BATCHES- Batch-based filtered searchHYBRID_BATCHES_TO_ADHOC_BF- Dynamic mode switchingRANGE_QUERY- Range-based vector searchExample:
Batch Execution Statistics
For queries using batch modes (
HYBRID_BATCHESorHYBRID_BATCHES_TO_ADHOC_BF), the profile now includes:Batches number- Total iterations executedLargest batch size- Maximum batch size usedLargest batch iteration (zero based)- When the largest batch occurredExample:
Note
Expose vector search execution mode and largest-batch statistics in FT.PROFILE for vector queries, with supporting iterator/state changes and tests.
Vector search modeto iterator profiles (VECTOR,METRIC - VECTOR DISTANCE).Batches number,Largest batch size, andLargest batch iteration (zero based).src/iterators/hybrid_reader.*):maxBatchSizeandmaxBatchIteration; initialize/reset on create/rewind; update during batched search.src/profile.*):src/vector_index.*):VecSimSearchMode_ToStringAPI for human-readable modes.tests/pytests/test_profile.py):Written by Cursor Bugbot for commit 07574d7. This will update automatically on new commits. Configure here.