Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 368df30

Browse files
committed
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.
1 parent 2d1d96b commit 368df30

File tree

11 files changed

+593
-203
lines changed

11 files changed

+593
-203
lines changed

src/backend/commands/explain.c

+40-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994-5, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.175 2008/05/14 19:10:29 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.176 2008/08/07 03:04:03 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -558,19 +558,47 @@ explain_outNode(StringInfo str,
558558
pname = "Unique";
559559
break;
560560
case T_SetOp:
561-
switch (((SetOp *) plan)->cmd)
561+
switch (((SetOp *) plan)->strategy)
562562
{
563-
case SETOPCMD_INTERSECT:
564-
pname = "SetOp Intersect";
563+
case SETOP_SORTED:
564+
switch (((SetOp *) plan)->cmd)
565+
{
566+
case SETOPCMD_INTERSECT:
567+
pname = "SetOp Intersect";
568+
break;
569+
case SETOPCMD_INTERSECT_ALL:
570+
pname = "SetOp Intersect All";
571+
break;
572+
case SETOPCMD_EXCEPT:
573+
pname = "SetOp Except";
574+
break;
575+
case SETOPCMD_EXCEPT_ALL:
576+
pname = "SetOp Except All";
577+
break;
578+
default:
579+
pname = "SetOp ???";
580+
break;
581+
}
565582
break;
566-
case SETOPCMD_INTERSECT_ALL:
567-
pname = "SetOp Intersect All";
568-
break;
569-
case SETOPCMD_EXCEPT:
570-
pname = "SetOp Except";
571-
break;
572-
case SETOPCMD_EXCEPT_ALL:
573-
pname = "SetOp Except All";
583+
case SETOP_HASHED:
584+
switch (((SetOp *) plan)->cmd)
585+
{
586+
case SETOPCMD_INTERSECT:
587+
pname = "HashSetOp Intersect";
588+
break;
589+
case SETOPCMD_INTERSECT_ALL:
590+
pname = "HashSetOp Intersect All";
591+
break;
592+
case SETOPCMD_EXCEPT:
593+
pname = "HashSetOp Except";
594+
break;
595+
case SETOPCMD_EXCEPT_ALL:
596+
pname = "HashSetOp Except All";
597+
break;
598+
default:
599+
pname = "HashSetOp ???";
600+
break;
601+
}
574602
break;
575603
default:
576604
pname = "SetOp ???";

0 commit comments

Comments
 (0)