Skip to content

Conversation

@akuzm
Copy link
Member

@akuzm akuzm commented Aug 7, 2025

Transform x = any(array[...]) into bloom1_contains_any function call that checks the array elements against the bloom filter sparse index.

Transform `x = any(array[...])` into `bloom1_contains_any`
function call that checks the array elements against the bloom filter.
@akuzm akuzm mentioned this pull request Aug 7, 2025
7 tasks
@github-actions
Copy link

github-actions bot commented Aug 7, 2025

@pnthao, @kpan2034: please review this pull request.

Powered by pull-review

@github-actions github-actions bot requested review from kpan2034 and pnthao August 7, 2025 09:31
Copy link
Member

@svenklemm svenklemm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be useful to have a dedicated GUC to disable this.

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 84.55285% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.53%. Comparing base (b03024e) to head (4628182).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
tsl/src/nodes/columnar_scan/qual_pushdown.c 78.43% 5 Missing and 6 partials ⚠️
...sl/src/compression/batch_metadata_builder_bloom1.c 88.73% 0 Missing and 8 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8465      +/-   ##
==========================================
+ Coverage   82.47%   82.53%   +0.06%     
==========================================
  Files         248      248              
  Lines       47950    48039      +89     
  Branches    12228    12257      +29     
==========================================
+ Hits        39547    39651     +104     
- Misses       3498     3525      +27     
+ Partials     4905     4863      -42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@akuzm
Copy link
Member Author

akuzm commented Aug 7, 2025

Might be useful to have a dedicated GUC to disable this.

It's a pretty small feature, at the moment it can be disabled with set timescaledb.enable_sparse_index_bloom to off;, is that good enough? We don't have any other kind of pushdown for these operations anyway at this point.

@natalya-aksman
Copy link
Member

Looks great, but maybe add more tests following Codecov suggestions: at least tests with coerced types and different collations.

}

List *expr_args = orig_saop->args;
if (list_length(expr_args) != 2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ScalarArrayOpExpr have other than 2 args? Maybe Assert would be better?

Copy link
Member

@dbeck dbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I'm curious, with this change, I bet we could also support the col = IN ('a', 'b', 'c') syntax too, right?

@akuzm
Copy link
Member Author

akuzm commented Nov 5, 2025

I'm curious, with this change, I bet we could also support the col = IN ('a', 'b', 'c') syntax too, right?

Yeah, it's rewritten to scalar array operation somewhere early, maybe during parsing. I added an example with this syntax to the test.

@akuzm akuzm enabled auto-merge (squash) November 10, 2025 13:50
@akuzm akuzm merged commit 4e9f2df into timescale:main Nov 10, 2025
51 of 54 checks passed
@akuzm akuzm deleted the contains-any branch November 10, 2025 13:50
melihmutlu added a commit to melihmutlu/timescaledb that referenced this pull request Nov 17, 2025
Added a missing cast that's been causing debug build failures on macos13
with PG18 after PR timescale#8465
melihmutlu added a commit to melihmutlu/timescaledb that referenced this pull request Nov 18, 2025
Added a missing cast that's been causing debug build failures on macos13
with PG18 after PR timescale#8465

Disable-check: force-changelog-file
melihmutlu added a commit that referenced this pull request Nov 18, 2025
Added a missing cast that's been causing debug build failures on macos13
with PG18 after PR #8465

Disable-check: force-changelog-file
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.

4 participants