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/plan/planner.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/plan/planner.c')
| -rw-r--r-- | src/backend/optimizer/plan/planner.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index 8afac0bda7..f3a0a44fd8 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -4534,7 +4534,7 @@ plan_cluster_use_sort(Oid tableOid, Oid indexOid) * set_baserel_size_estimates, just do a quick hack for rows and width. */ rel->rows = rel->tuples; - rel->reltarget.width = get_relation_data_width(tableOid, NULL); + rel->reltarget->width = get_relation_data_width(tableOid, NULL); root->total_table_pages = rel->pages; @@ -4550,7 +4550,7 @@ plan_cluster_use_sort(Oid tableOid, Oid indexOid) /* Estimate the cost of seq scan + sort */ seqScanPath = create_seqscan_path(root, rel, NULL, 0); cost_sort(&seqScanAndSortPath, root, NIL, - seqScanPath->total_cost, rel->tuples, rel->reltarget.width, + seqScanPath->total_cost, rel->tuples, rel->reltarget->width, comparisonCost, maintenance_work_mem, -1.0); /* Estimate the cost of index scan */ |
