Skip to main content

Module shard_split

Module shard_split 

Source
Expand description

Shard splitting: vector-aware and graph-aware partitioning.

When a shard becomes overloaded, it can be split into two shards. The splitting strategy is engine-aware:

  • Vector-aware: split by collection + partition key. Each resulting shard holds a subset of the collection’s vectors with its own HNSW index. Cross-shard k-NN queries use scatter-gather with result merging on the Control Plane.

  • Graph-aware: balanced partitioning minimizing cross-shard edges. Uses a greedy heuristic (BFS-based community detection) rather than full METIS for practical performance. Cross-shard traversals use existing scatter-gather infrastructure with ghost edges.

  • Speculative prefetch: when scatter-gather dispatches to multiple shards, co-located vector and graph shards for the same tenant are prefetched together to reduce round-trip latency.

Structs§

SplitPlan
A shard split plan: which vectors/documents move to the new shard.

Enums§

SplitStrategy
Splitting strategy.

Functions§

plan_graph_split
Plan a graph-aware shard split.
plan_vector_split
Plan a vector-aware shard split.
speculative_prefetch_shards
Speculative prefetch plan for cross-shard scatter-gather queries.