Skip to content

Commit

Permalink
[AQUMV] Use contain_var_clause instead of pull_var_clause.
Browse files Browse the repository at this point in the history
We don't need var list of expression, only a result is enough.

Authored-by: Zhang Mingli avamingli@gmail.com
  • Loading branch information
avamingli committed Jun 6, 2024
1 parent ccfdc18 commit c34727a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/backend/optimizer/plan/aqumv.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,16 +730,10 @@ static Node *aqumv_adjust_sub_matched_expr_mutator(Node *node, aqumv_equivalent_
/*
* We didn't find matched nonpure-Var expr.
* And if expr doesn't have Vars, return it to upper.
* Keep TargetEntry expr no changed in case for count(*).
*/
List *expr_vars = pull_var_clause((Node *)node_expr,
PVC_RECURSE_AGGREGATES |
PVC_RECURSE_WINDOWFUNCS |
PVC_INCLUDE_PLACEHOLDERS);

/* Keep TargetEntry expr no changed in case for count(*). */
if (expr_vars == NIL)
if (!contain_var_clause((Node *)node_expr))
return is_targetEntry ? node : (Node *)node_expr;
list_free(expr_vars);

/* Try match with mv_pure_vars_index, but do not disturb already rewrited exprs(Var->location = -2) */
if (IsA(node_expr, Var))
Expand Down

0 comments on commit c34727a

Please sign in to comment.