timescaledb icon indicating copy to clipboard operation
timescaledb copied to clipboard

Block OR BoolExpr from pushdown

Open svenklemm opened this issue 1 month ago • 4 comments

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

Fixes #6912

svenklemm avatar May 14 '24 10:05 svenklemm

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.

akuzm avatar May 15 '24 17:05 akuzm

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 avatar May 16 '24 07:05 svenklemm

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.

svenklemm avatar May 17 '24 20:05 svenklemm

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.

akuzm avatar May 18 '24 14:05 akuzm

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
@@            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.

codecov[bot] avatar May 19 '24 14:05 codecov[bot]