perf: use ShardMergeReader for non-PQ index types#6289
perf: use ShardMergeReader for non-PQ index types#6289hushengquan wants to merge 1 commit intolance-format:mainfrom
Conversation
PR ReviewClean change — reusing Two items to address: 1. Dead code:
|
705e076 to
719c2e6
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Thank you very much for this PR! I think this change is great, but I want to raise one point: we are also limited by memory usage. A non-PQ index uses more memory than a PQ index, that’s why we didn’t have this feature in the first place. IVF_SQ/IVF_FLAT can have large payloads and large partitions. Therefore, I believe we should ensure our new logic works well in multi‑batch and large‑partition scenarios, and make sure we do not store an entire partition in memory before writing it out. |
Got it, thank you! |
Problem Description
When processing the
merge_partial_vector_auxiliary_filesstage for theivf-sqindex on a dataset of 5 million records with 8 workers and 2236 partitions, the operation takes an excessively long time (3780 seconds), which significantly impacts the overall efficiency of vector index merging.(#6288 )Root Cause
The current implementation of merging partial vector auxiliary files lacks shard-based parallelism optimization, leading to serial processing bottlenecks when handling a large number of partitions and datasets.
Proposed Solution
Use
ShardMergeReaderto leverage shard-level parallelism for merging partial vector auxiliary files. This optimization distributes the merge workload across multiple shards, reducing the overall processing time.Performance Metrics (Before/After)
merge_partial_vector_auxiliary_files(ivf_sq index)Additional Context
ivf_sqShardMergeReader(shard-based parallel merge logic)