Skip to content

Commit

Permalink
Shortcut ft matching process with one posting list
Browse files Browse the repository at this point in the history
  • Loading branch information
amosbird committed Jun 14, 2024
1 parent 46cbcf5 commit 7aeeb19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Interpreters/GinFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ bool GinFilter::match(const GinPostingsCache & postings_cache) const
if (hasEmptyPostingsList(postings_cache))
return false;

/// If there is only one non-empty posting list, it is a match.
if (postings_cache.size() == 1)
return true;

/// Check for each row ID ranges
for (const auto & rowid_range: rowid_ranges)
if (matchInRange(postings_cache, rowid_range.segment_id, rowid_range.range_start, rowid_range.range_end))
Expand Down

0 comments on commit 7aeeb19

Please sign in to comment.