Skip to content

feat(btree): add btree global index reader/writer/factory#89

Open
lszskye wants to merge 1 commit into
apache:mainfrom
lszskye:p7-4
Open

feat(btree): add btree global index reader/writer/factory#89
lszskye wants to merge 1 commit into
apache:mainfrom
lszskye:p7-4

Conversation

@lszskye

@lszskye lszskye commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Add BTree Global Index Reader with Lazy Filtering Support

Summary

Implement BTree-based global index reader with lazy file filtering, complementing the existing BTree global index writer. This enables efficient predicate evaluation over BTree global index files with metadata-based file pruning to minimize I/O.

New Classes

BTreeGlobalIndexer — Top-level indexer implementation for BTree global index. Instead of building a B-Tree directly in memory, it forms a logical B-Tree via multi-level metadata over SST files, significantly reducing memory pressure during index reads. Responsible for creating corresponding Writer and Reader instances.

BTreeGlobalIndexReader — Single-file reader for BTree global index. Evaluates filter predicates (Equal, Range, In, StartsWith, etc.) against an SST file structure where each key maps to a list of row IDs. Supports null bitmap handling and min/max key pruning for fast short-circuiting.

BTreeGlobalIndexWriter — Writer for BTree global index files. Writes keys in monotonically increasing order into SST files, merging entries with identical keys into compact row ID lists. Null keys are tracked via a separate RoaringBitmap, serialized and appended to the file end on close.

BTreeGlobalIndexerFactory — Factory class for BTree global indexers. Implements the GlobalIndexerFactory interface and creates BTreeGlobalIndexer instances from configuration options.

LazyFilteredBTreeReader — Lazy-loading, file-filtering BTree global index reader for multi-file scenarios. Uses BTreeFileMetaSelector to prune candidate files based on predicate conditions before lazily instantiating per-file readers on demand. Supports reader caching and parallel execution.

New Tests

  • btree_compatibility_test.cpp
  • lazy_filtered_btree_reader_test.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant