diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-14 16:59:59 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-14 16:59:59 -0400 |
| commit | 307c78852f516042cebacaed411a0391bfeb2129 (patch) | |
| tree | afa2959e11e171e93411164a7e5b0adfa3609700 /src/backend/optimizer/path/indxpath.c | |
| parent | 07341a2980a37ccbb3a51af2bd2f3c87953d8ea4 (diff) | |
| download | postgresql-307c78852f516042cebacaed411a0391bfeb2129.tar.gz | |
Rethink representation of PathTargets.
In commit 19a541143a09c067 I did not make PathTarget a subtype of Node,
and embedded a RelOptInfo's reltarget directly into it rather than having
a separately-allocated Node. In hindsight that was misguided
micro-optimization, enabled by the fact that at that point we didn't have
any Paths with custom PathTargets. Now that PathTarget processing has
been fleshed out some more, it's easier to see that it's better to have
PathTarget as an indepedent Node type, even if it does cost us one more
palloc to create a RelOptInfo. So change it while we still can.
This commit just changes the representation, without doing anything more
interesting than that.
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
| -rw-r--r-- | src/backend/optimizer/path/indxpath.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index ddb4ca50c6..b48f5f28ea 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -1550,7 +1550,7 @@ bitmap_scan_cost_est(PlannerInfo *root, RelOptInfo *rel, Path *ipath) bpath.path.type = T_BitmapHeapPath; bpath.path.pathtype = T_BitmapHeapScan; bpath.path.parent = rel; - bpath.path.pathtarget = &(rel->reltarget); + bpath.path.pathtarget = rel->reltarget; bpath.path.param_info = get_baserel_parampathinfo(root, rel, required_outer); bpath.path.pathkeys = NIL; @@ -1579,7 +1579,7 @@ bitmap_and_cost_est(PlannerInfo *root, RelOptInfo *rel, List *paths) apath.path.type = T_BitmapAndPath; apath.path.pathtype = T_BitmapAnd; apath.path.parent = rel; - apath.path.pathtarget = &(rel->reltarget); + apath.path.pathtarget = rel->reltarget; apath.path.param_info = NULL; /* not used in bitmap trees */ apath.path.pathkeys = NIL; apath.bitmapquals = paths; @@ -1592,7 +1592,7 @@ bitmap_and_cost_est(PlannerInfo *root, RelOptInfo *rel, List *paths) bpath.path.type = T_BitmapHeapPath; bpath.path.pathtype = T_BitmapHeapScan; bpath.path.parent = rel; - bpath.path.pathtarget = &(rel->reltarget); + bpath.path.pathtarget = rel->reltarget; bpath.path.param_info = get_baserel_parampathinfo(root, rel, required_outer); bpath.path.pathkeys = NIL; @@ -1815,7 +1815,7 @@ check_index_only(RelOptInfo *rel, IndexOptInfo *index) * look at rel's targetlist, not the attr_needed data, because attr_needed * isn't computed for inheritance child rels. */ - pull_varattnos((Node *) rel->reltarget.exprs, rel->relid, &attrs_used); + pull_varattnos((Node *) rel->reltarget->exprs, rel->relid, &attrs_used); /* Add all the attributes used by restriction clauses. */ foreach(lc, rel->baserestrictinfo) |
