Skip to content

ivfpq: Push down row filters for 8-bit batch scans - #64

Merged
JingsongLi merged 3 commits into
apache:mainfrom
shyjsarah:codex/ivfpq-filter-pushdown-20260727
Jul 29, 2026
Merged

ivfpq: Push down row filters for 8-bit batch scans#64
JingsongLi merged 3 commits into
apache:mainfrom
shyjsarah:codex/ivfpq-filter-pushdown-20260727

Conversation

@shyjsarah

@shyjsarah shyjsarah commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Optimize selective row-filtered IVF-PQ batch scanning by evaluating filters once per relevant inverted list and sharing the resulting matches across all queries in a batch.

This change focuses distance-computation pushdown on the standard 8-bit IVF-PQ scan paths while preserving existing 4-bit and FastScan scoring behavior.

Changes

  • Materialize matching rows once per probed or loaded inverted list instead of evaluating the filter for every query.
  • Evaluate in-memory filters only for lists actually probed by the current query batch.
  • Represent sparse matches as positions and switch dense matches to a compact bitmap.
  • Scan only matching rows in selective 8-bit row-major and transposed layouts.
  • Stream dense row-major scans directly into the top-k heap without allocating a list-sized distance buffer.
  • Preserve existing 4-bit and FastScan distance semantics.
  • Keep public APIs unchanged.

Testing

  • cargo fmt --all -- --check
  • cargo clippy -p paimon-vindex-core --all-targets -- -D warnings
  • cargo test -p paimon-vindex-core --locked
  • Added coverage for:
    • filters evaluated once per loaded/probed row,
    • unprobed lists skipped,
    • sparse 8-bit row-major and transposed scans,
    • dense bitmap scans.

Notes

@shyjsarah
shyjsarah force-pushed the codex/ivfpq-filter-pushdown-20260727 branch from dd1f7c5 to 353a1f1 Compare July 28, 2026 13:10
@shyjsarah shyjsarah changed the title [WIP] ivfpq: Optimize filtered batch search [WIP] ivfpq: Optimize filtered batch scanning Jul 28, 2026
@shyjsarah shyjsarah changed the title [WIP] ivfpq: Optimize filtered batch scanning ivfpq: Optimize filtered batch scanning Jul 29, 2026
@shyjsarah shyjsarah changed the title ivfpq: Optimize filtered batch scanning ivfpq: Push down row filters for 8-bit batch scans Jul 29, 2026
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit a722d21 into apache:main Jul 29, 2026
9 checks passed
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.

2 participants