Skip to content

[common] Accelerate endsWith and like '%x' with reverse btree global index#8371

Open
ArnavBalyan wants to merge 1 commit into
apache:masterfrom
ArnavBalyan:arnavb/btree-suffix-support
Open

[common] Accelerate endsWith and like '%x' with reverse btree global index#8371
ArnavBalyan wants to merge 1 commit into
apache:masterfrom
ArnavBalyan:arnavb/btree-suffix-support

Conversation

@ArnavBalyan

@ArnavBalyan ArnavBalyan commented Jun 28, 2026

Copy link
Copy Markdown
Member

Purpose:

  • Introduce a reverse btree global index:
    • This can be used to serve variety of queries using endsWith and LIKE '%abc' patterns.
    • Stores keys which are reversed (using ReversedKeySerializer), allowing a suffix query to be converted into a prefix scan of the reversed values.
  • ReverseLazyFilteredBTreeReader routes endsWith and like queries through the existing prefix scan, and uses min/max pruning instead of full scan.
  • Reuses the existing btree file format (only key bytes are reversed). In the future more complex like clauses can be offloaded in combination with the straight btree index.

Tests

  • Unit Tests

@ArnavBalyan

Copy link
Copy Markdown
Member Author

cc @JingsongLi @leaves12138 thanks! :)

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