diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-21 00:04:40 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-21 00:04:40 +0000 |
| commit | 596efd27edce20bba706f50de99a0f15bcc2a567 (patch) | |
| tree | 63c07c3c310e1b072f0a29a79220c81254dba3d8 /src/include/nodes/plannodes.h | |
| parent | 249d936bed069877923f0369bd2ce51a6f8f925e (diff) | |
| download | postgresql-596efd27edce20bba706f50de99a0f15bcc2a567.tar.gz | |
Optimize multi-batch hash joins when the outer relation has a nonuniform
distribution, by creating a special fast path for the (first few) most common
values of the outer relation. Tuples having hashvalues matching the MCVs
are effectively forced to be in the first batch, so that we never write
them out to the batch temp files.
Bryce Cutt and Ramon Lawrence, with some editorialization by me.
Diffstat (limited to 'src/include/nodes/plannodes.h')
| -rw-r--r-- | src/include/nodes/plannodes.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index 12742b57e5..9caf0895e4 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/plannodes.h,v 1.108 2009/01/01 17:24:00 momjian Exp $ + * $PostgreSQL: pgsql/src/include/nodes/plannodes.h,v 1.109 2009/03/21 00:04:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -460,7 +460,7 @@ typedef struct MergeJoin } MergeJoin; /* ---------------- - * hash join (probe) node + * hash join node * ---------------- */ typedef struct HashJoin @@ -567,11 +567,20 @@ typedef struct Unique /* ---------------- * hash build node + * + * If the executor is supposed to try to apply skew join optimization, then + * skewTable/skewColumn identify the outer relation's join key column, from + * which the relevant MCV statistics can be fetched. Also, its type + * information is provided to save a lookup. * ---------------- */ typedef struct Hash { Plan plan; + Oid skewTable; /* outer join key's table OID, or InvalidOid */ + AttrNumber skewColumn; /* outer join key's column #, or zero */ + Oid skewColType; /* datatype of the outer key column */ + int32 skewColTypmod; /* typmod of the outer key column */ /* all other info is in the parent HashJoin node */ } Hash; |
