summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/prepunion.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-01-04 03:51:52 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-01-04 03:51:52 +0000
commit82b4dd394f50f75a34d3ddc1c7d54b8d8fcace33 (patch)
tree1fb959074c117f48b987a77e7632ec6bbcc583da /src/backend/optimizer/prep/prepunion.c
parent21a12022818b6ac418d7a1544e92f8b13d61cc91 (diff)
Merge restrictlist_selectivity into clauselist_selectivity by
teaching the latter to accept either RestrictInfo nodes or bare clause expressions; and cache the selectivity result in the RestrictInfo node when possible. This extends the caching behavior of approx_selectivity to many more contexts, and should reduce duplicate selectivity calculations.
Diffstat (limited to 'src/backend/optimizer/prep/prepunion.c')
-rw-r--r--src/backend/optimizer/prep/prepunion.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c
index 6866e95e4b3..d52f2a73417 100644
--- a/src/backend/optimizer/prep/prepunion.c
+++ b/src/backend/optimizer/prep/prepunion.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.106 2004/01/04 00:07:32 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/prep/prepunion.c,v 1.107 2004/01/04 03:51:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -885,9 +885,10 @@ adjust_inherited_attrs_mutator(Node *node,
newinfo->orclause = (Expr *)
adjust_inherited_attrs_mutator((Node *) oldinfo->orclause, context);
- /*
- * Adjust left/right relid sets too.
- */
+ /* adjust relid sets too */
+ newinfo->clause_relids = adjust_relid_set(oldinfo->clause_relids,
+ context->old_rt_index,
+ context->new_rt_index);
newinfo->left_relids = adjust_relid_set(oldinfo->left_relids,
context->old_rt_index,
context->new_rt_index);