diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-05 02:43:18 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-08-05 02:43:18 +0000 |
| commit | be3b265c94443b75262e89149f148ace0fdf75da (patch) | |
| tree | 198e00992b5716d917d3f900a98f742e1d8228b5 /src/test/regress/output/misc.source | |
| parent | 4abd7b49f1e9eb1ccc934be5efabb6fd531d0141 (diff) | |
| download | postgresql-be3b265c94443b75262e89149f148ace0fdf75da.tar.gz | |
Improve SELECT DISTINCT to consider hash aggregation, as well as sort/uniq,
as methods for implementing the DISTINCT step. This eliminates the former
performance gap between DISTINCT and GROUP BY, and also makes it possible
to do SELECT DISTINCT on datatypes that only support hashing not sorting.
SELECT DISTINCT ON is still always implemented by sorting; it would take
executor changes to support hashing that, and it's not clear it's worth
the trouble.
This is a release-note-worthy incompatibility from previous PG versions,
since SELECT DISTINCT can no longer be counted on to deliver sorted output
without explicitly saying ORDER BY. (Anyone who can't cope with that
can consider turning off enable_hashagg.)
Several regression test queries needed to have ORDER BY added to preserve
stable output order. I fixed the ones that manifested here, but there
might be some other cases that show up on other platforms.
Diffstat (limited to 'src/test/regress/output/misc.source')
| -rw-r--r-- | src/test/regress/output/misc.source | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/regress/output/misc.source b/src/test/regress/output/misc.source index e409c0a100..91e0d2b04d 100644 --- a/src/test/regress/output/misc.source +++ b/src/test/regress/output/misc.source @@ -469,7 +469,8 @@ SELECT p.name, name(p.hobbies) FROM person* p; -- the next two queries demonstrate how functions generate bogus duplicates. -- this is a "feature" .. -- -SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r; +SELECT DISTINCT hobbies_r.name, name(hobbies_r.equipment) FROM hobbies_r + ORDER BY 1,2; name | name -------------+--------------- basketball | hightops |
