mirror of
https://github.com/postgres/postgres.git
synced 2025-07-09 22:41:56 +03:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user