diff options
author | Neil Conway <neilc@samurai.com> | 2006-03-05 21:34:34 +0000 |
---|---|---|
committer | Neil Conway <neilc@samurai.com> | 2006-03-05 21:34:34 +0000 |
commit | 99114a2473a57384246e2f61c79b97ccd376acc8 (patch) | |
tree | dbd24450f7fb9cecb85f90db65a40b7fb0f68673 /src/backend/parser/parse_coerce.c | |
parent | f9520ac110144762336da839b4f3a4ef0e145356 (diff) | |
download | postgresql-99114a2473a57384246e2f61c79b97ccd376acc8.tar.gz postgresql-99114a2473a57384246e2f61c79b97ccd376acc8.zip |
Per recent discussion on -hackers, we should sometimes reorder the
columns of the grouping clause to avoid redundant sorts. The optimizer
is not currently capable of doing this, so this patch implements a
simple hack in the analysis phase (transformGroupClause): if any
subset of the GROUP BY clause matches a prefix of the ORDER BY list,
that prefix is moved to the front of the GROUP BY clause. This
shouldn't change the semantics of the query, and allows a redundant
sort to be avoided for queries like "GROUP BY a, b ORDER BY b".
Diffstat (limited to 'src/backend/parser/parse_coerce.c')
0 files changed, 0 insertions, 0 deletions