forked from quickwit-oss/tantivy
-
Notifications
You must be signed in to change notification settings - Fork 6
perf: Implement a TermSet variant which uses fast fields #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… with a fast field column.
7b5d85c to
72a22f6
Compare
Collaborator
Author
|
Upstream at quickwit-oss#2718 |
rebasedming
approved these changes
Oct 16, 2025
stuhood
added a commit
to paradedb/paradedb
that referenced
this pull request
Oct 16, 2025
## What Add a variant of `TermSet` for very large sets of terms which scans a fast fields column and intersects it with the `TermSet`. ## Why ParadeDB users occasionally use `TermSet` as a "limited total size join" between two tables (essentially: an explicit hash join). But the implementation of `TermSet` which operates on posting lists requires creating one `Scorer` per term, and might potentially seek many times to read and merge posting lists. This implementation is approximately 2x faster for a `paradedb.aggregate` call operating over an input `TermSet` query containing 10mm bigint terms. ## How See paradedb/tantivy#69.
github-actions bot
pushed a commit
to paradedb/paradedb
that referenced
this pull request
Oct 16, 2025
## What Add a variant of `TermSet` for very large sets of terms which scans a fast fields column and intersects it with the `TermSet`. ## Why ParadeDB users occasionally use `TermSet` as a "limited total size join" between two tables (essentially: an explicit hash join). But the implementation of `TermSet` which operates on posting lists requires creating one `Scorer` per term, and might potentially seek many times to read and merge posting lists. This implementation is approximately 2x faster for a `paradedb.aggregate` call operating over an input `TermSet` query containing 10mm bigint terms. ## How See paradedb/tantivy#69.
github-actions bot
pushed a commit
to paradedb/paradedb
that referenced
this pull request
Oct 16, 2025
## What Add a variant of `TermSet` for very large sets of terms which scans a fast fields column and intersects it with the `TermSet`. ## Why ParadeDB users occasionally use `TermSet` as a "limited total size join" between two tables (essentially: an explicit hash join). But the implementation of `TermSet` which operates on posting lists requires creating one `Scorer` per term, and might potentially seek many times to read and merge posting lists. This implementation is approximately 2x faster for a `paradedb.aggregate` call operating over an input `TermSet` query containing 10mm bigint terms. ## How See paradedb/tantivy#69.
This was referenced Oct 16, 2025
stuhood
added a commit
to paradedb/paradedb
that referenced
this pull request
Oct 16, 2025
## What Add a variant of `TermSet` for very large sets of terms which scans a fast fields column and intersects it with the `TermSet`. ## Why ParadeDB users occasionally use `TermSet` as a "limited total size join" between two tables (essentially: an explicit hash join). But the implementation of `TermSet` which operates on posting lists requires creating one `Scorer` per term, and might potentially seek many times to read and merge posting lists. This implementation is approximately 2x faster for a `paradedb.aggregate` call operating over an input `TermSet` query containing 10mm bigint terms. ## How See paradedb/tantivy#69. Co-authored-by: Stu Hood <[email protected]>
stuhood
added a commit
to paradedb/paradedb
that referenced
this pull request
Oct 16, 2025
## What Add a variant of `TermSet` for very large sets of terms which scans a fast fields column and intersects it with the `TermSet`. ## Why ParadeDB users occasionally use `TermSet` as a "limited total size join" between two tables (essentially: an explicit hash join). But the implementation of `TermSet` which operates on posting lists requires creating one `Scorer` per term, and might potentially seek many times to read and merge posting lists. This implementation is approximately 2x faster for a `paradedb.aggregate` call operating over an input `TermSet` query containing 10mm bigint terms. ## How See paradedb/tantivy#69. Co-authored-by: Stu Hood <[email protected]>
mdashti
pushed a commit
that referenced
this pull request
Oct 21, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
mdashti
pushed a commit
that referenced
this pull request
Oct 22, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
mdashti
pushed a commit
that referenced
this pull request
Oct 22, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
mdashti
pushed a commit
that referenced
this pull request
Dec 3, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
mdashti
pushed a commit
that referenced
this pull request
Dec 3, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
mdashti
pushed a commit
that referenced
this pull request
Dec 3, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
stuhood
added a commit
that referenced
this pull request
Dec 3, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
stuhood
added a commit
that referenced
this pull request
Dec 10, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
stuhood
added a commit
that referenced
this pull request
Dec 10, 2025
The `TermSet` `Query` currently produces one `Scorer`/`DocSet` per matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with a `HashSet` of (encoded) term values. Following the pattern set by the two execution modes of `RangeQuery`, this PR introduces a variant of `TermSet` which uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!). Performance is significantly improved for large `TermSet`s of primitives.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
TermSetQuerycurrently produces oneScorer/DocSetper matched term by scanning the term dictionary and then consuming posting lists. For very large sets of terms and a fast field, it is faster to scan the fast field column while intersecting with aHashSetof (encoded) term values.Following the pattern set by the two execution modes of
RangeQuery, this PR introduces a variant ofTermSetwhich uses fast fields, and then uses it when there are more than 1024 input terms (an arbitrary threshold!).Performance is significantly improved for large
TermSets of primitives.