diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-26 17:15:35 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-26 17:15:35 +0000 |
| commit | f38fbf31f5719bb84b18042a7f415a4f20db2bfa (patch) | |
| tree | 9de323400560bd677e4402727b1f6bb3ec9834e9 /src/backend/optimizer/plan/createplan.c | |
| parent | ee4c187f6471af5f71fd5dd12021fa8d7c4fce11 (diff) | |
If we expect a hash join to be performed in multiple batches, suppress
"physical tlist" optimization on the outer relation (ie, force a projection
step to occur in its scan). This avoids storing useless column values when
the outer relation's tuples are written to temporary batch files.
Modified version of a patch by Michael Henderson and Ramon Lawrence.
Diffstat (limited to 'src/backend/optimizer/plan/createplan.c')
| -rw-r--r-- | src/backend/optimizer/plan/createplan.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c index be4d79f1bf2..cff0424c6c7 100644 --- a/src/backend/optimizer/plan/createplan.c +++ b/src/backend/optimizer/plan/createplan.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.256 2009/03/21 00:04:39 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.257 2009/03/26 17:15:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1910,6 +1910,10 @@ create_hashjoin_plan(PlannerInfo *root, /* We don't want any excess columns in the hashed tuples */ disuse_physical_tlist(inner_plan, best_path->jpath.innerjoinpath); + /* If we expect batching, suppress excess columns in outer tuples too */ + if (best_path->num_batches > 1) + disuse_physical_tlist(outer_plan, best_path->jpath.outerjoinpath); + /* * If there is a single join clause and we can identify the outer * variable as a simple column reference, supply its identity for |
