diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-07 03:04:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-07 03:04:04 +0000 |
commit | 368df3042783778031ece2b8580324516cd42de1 (patch) | |
tree | dd6f9877cdc12654647a97785c4e7267cc7ac945 /src/backend/commands/explain.c | |
parent | 2d1d96b1cea8f67a095e8f28372af4081605f681 (diff) | |
download | postgresql-368df3042783778031ece2b8580324516cd42de1.tar.gz postgresql-368df3042783778031ece2b8580324516cd42de1.zip |
Support hashing for duplicate-elimination in INTERSECT and EXCEPT queries.
This completes my project of improving usage of hashing for duplicate
elimination (aggregate functions with DISTINCT remain undone, but that's
for some other day).
As with the previous patches, this means we can INTERSECT/EXCEPT on datatypes
that can hash but not sort, and it means that INTERSECT/EXCEPT without ORDER
BY are no longer certain to produce sorted output.
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 0892cdbe3eb..1fd6f0cb331 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994-5, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.175 2008/05/14 19:10:29 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.176 2008/08/07 03:04:03 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -558,19 +558,47 @@ explain_outNode(StringInfo str, pname = "Unique"; break; case T_SetOp: - switch (((SetOp *) plan)->cmd) + switch (((SetOp *) plan)->strategy) { - case SETOPCMD_INTERSECT: - pname = "SetOp Intersect"; + case SETOP_SORTED: + switch (((SetOp *) plan)->cmd) + { + case SETOPCMD_INTERSECT: + pname = "SetOp Intersect"; + break; + case SETOPCMD_INTERSECT_ALL: + pname = "SetOp Intersect All"; + break; + case SETOPCMD_EXCEPT: + pname = "SetOp Except"; + break; + case SETOPCMD_EXCEPT_ALL: + pname = "SetOp Except All"; + break; + default: + pname = "SetOp ???"; + break; + } break; - case SETOPCMD_INTERSECT_ALL: - pname = "SetOp Intersect All"; - break; - case SETOPCMD_EXCEPT: - pname = "SetOp Except"; - break; - case SETOPCMD_EXCEPT_ALL: - pname = "SetOp Except All"; + case SETOP_HASHED: + switch (((SetOp *) plan)->cmd) + { + case SETOPCMD_INTERSECT: + pname = "HashSetOp Intersect"; + break; + case SETOPCMD_INTERSECT_ALL: + pname = "HashSetOp Intersect All"; + break; + case SETOPCMD_EXCEPT: + pname = "HashSetOp Except"; + break; + case SETOPCMD_EXCEPT_ALL: + pname = "HashSetOp Except All"; + break; + default: + pname = "HashSetOp ???"; + break; + } break; default: pname = "SetOp ???"; |