Skip to content

Commit 48a1fb2

Browse files
committed
Oops, missed one fix for EquivalenceClass rearrangement.
Now that we're expecting a mergeclause's left_ec/right_ec to persist from the initial assignments, we can't just blithely zero these out when transforming such a clause in adjust_appendrel_attrs. But really it should be okay to keep the parent's values, since a child table's derived Var ought to be equivalent to the parent Var for all EquivalenceClass purposes. (Indeed, I'm wondering whether we couldn't find a way to dispense with add_child_rel_equivalences altogether. But this is wrong in any case.)
1 parent 14231a4 commit 48a1fb2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/optimizer/prep/prepunion.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,13 +1682,13 @@ adjust_appendrel_attrs_mutator(Node *node, AppendRelInfo *context)
16821682

16831683
/*
16841684
* Reset cached derivative fields, since these might need to have
1685-
* different values when considering the child relation.
1685+
* different values when considering the child relation. Note we
1686+
* don't reset left_ec/right_ec: each child variable is implicitly
1687+
* equivalent to its parent, so still a member of the same EC if any.
16861688
*/
16871689
newinfo->eval_cost.startup = -1;
16881690
newinfo->norm_selec = -1;
16891691
newinfo->outer_selec = -1;
1690-
newinfo->left_ec = NULL;
1691-
newinfo->right_ec = NULL;
16921692
newinfo->left_em = NULL;
16931693
newinfo->right_em = NULL;
16941694
newinfo->scansel_cache = NIL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy