timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.61k stars 883 forks source link

Block OR BoolExpr from pushdown #6917

Closed svenklemm closed 4 months ago

svenklemm commented 4 months ago

RestrictInfo with OR need special handling which we currently do not do which can lead to segfaults in planner if unhandled.

Fixes #6912

akuzm commented 4 months ago

What exactly is broken? I reproduced it but I have no idea what's going on... Theoretically, the make_restrictinfo should take care of creating the proper orclause as well.

svenklemm commented 4 months ago

What exactly is broken? I reproduced it but I have no idea what's going on... Theoretically, the make_restrictinfo should take care of creating the proper orclause as well.

Not yet sure what is going wrong there but the or branches are not wrapped in restrictinfos

svenklemm commented 4 months ago

It fixes the segfault but won't it create some perf regression?

Potentially yes. Ideally we can reenable this in followup PR after we fix OR processing.

akuzm commented 4 months ago

Potentially yes. Ideally we can reenable this in followup PR after we fix OR processing.

Let's go with the thing we discussed on Slack -- avoiding nested AND boolexprs by applying eval_const_expressions after modify_expression in pushdown_quals. I checked that it fixes this case.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.83%. Comparing base (59f50f2) to head (5b9ffa0). Report is 164 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6917 +/- ## ========================================== + Coverage 80.06% 80.83% +0.77% ========================================== Files 190 199 +9 Lines 37181 37195 +14 Branches 9450 9704 +254 ========================================== + Hits 29770 30068 +298 - Misses 2997 3246 +249 + Partials 4414 3881 -533 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.