From 596efd27edce20bba706f50de99a0f15bcc2a567 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 21 Mar 2009 00:04:40 +0000 Subject: 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. --- src/backend/nodes/copyfuncs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/backend/nodes/copyfuncs.c') diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index 3c8bf6fb69a..f9a1efdc447 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -15,7 +15,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.426 2009/03/10 22:09:25 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.427 2009/03/21 00:04:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -735,6 +735,10 @@ _copyHash(Hash *from) /* * copy remainder of node */ + COPY_SCALAR_FIELD(skewTable); + COPY_SCALAR_FIELD(skewColumn); + COPY_SCALAR_FIELD(skewColType); + COPY_SCALAR_FIELD(skewColTypmod); return newnode; } -- cgit v1.2.3