summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/allpaths.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-11 18:13:54 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-11 18:13:54 +0000
commit5aa70422df0ef37fcc995d63bb9a5113805c0f69 (patch)
treebca11505d2890eaa41e8186b12d9ce5669096814 /src/backend/optimizer/path/allpaths.c
parent8f74153732c512baa498eb6c38244c0d3a09dff8 (diff)
Get rid of adjust_appendrel_attr_needed(), which has been broken ever since
we extended the appendrel mechanism to support UNION ALL optimization. The reason nobody noticed was that we are not actually using attr_needed data for appendrel children; hence it seems more reasonable to rip it out than fix it. Back-patch to 8.2 because an Assert failure is possible in corner cases. Per examination of an example from Jim Nasby. In HEAD, also get rid of AppendRelInfo.col_mappings, which is quite inadequate to represent UNION ALL situations; depend entirely on translated_vars instead.
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r--src/backend/optimizer/path/allpaths.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index bd8c7816c40..88b09a2a8ba 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.154.2.2 2008/01/11 04:02:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.154.2.3 2008/11/11 18:13:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -326,14 +326,12 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
appinfo);
/*
- * Copy the parent's attr_needed data as well, with appropriate
- * adjustment of relids and attribute numbers.
+ * Note: we could compute appropriate attr_needed data for the
+ * child's variables, by transforming the parent's attr_needed
+ * through the translated_vars mapping. However, currently there's
+ * no need because attr_needed is only examined for base relations
+ * not otherrels. So we just leave the child's attr_needed empty.
*/
- pfree(childrel->attr_needed);
- childrel->attr_needed =
- adjust_appendrel_attr_needed(rel, appinfo,
- childrel->min_attr,
- childrel->max_attr);
/*
* Compute the child's access paths, and add the cheapest one to the