Skip to content

Commit

Permalink
Re-enable compressed OR boolexpr pushdown (#6948)
Browse files Browse the repository at this point in the history
To fix the original problem, it is enough to call
eval_const_expressions() to normalize the nested AND boolexprs.

(cherry picked from commit 00fc782)
  • Loading branch information
akuzm authored and fabriziomello committed May 26, 2024
1 parent 03d2300 commit 03fe320
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tsl/src/nodes/decompress_chunk/qual_pushdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,18 @@ pushdown_quals(PlannerInfo *root, CompressionSettings *settings, RelOptInfo *chu
context.can_pushdown = true;
context.needs_recheck = false;
expr = (Expr *) modify_expression((Node *) ri->clause, &context);

if (context.can_pushdown)
{
/*
* We have to call eval_const_expressions after pushing down
* the quals, to normalize the bool expressions. Namely, we might add an
* AND boolexpr on minmax metadata columns, but the normal form is not
* allowed to have nested AND boolexprs. They break some functions like
* generate_bitmap_or_paths().
*/
expr = (Expr *) eval_const_expressions(root, (Node *) expr);

if (IsA(expr, BoolExpr) && ((BoolExpr *) expr)->boolop == AND_EXPR)
{
/* have to separate out and expr into different restrict infos */
Expand Down

0 comments on commit 03fe320

Please sign in to comment.