From: | neilc(at)postgresql(dot)org (Neil Conway) |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Per recent discussion on -hackers, we should sometimes reorder |
Date: | 2006-03-05 21:34:34 |
Message-ID: | 20060305213434.F03D79DCCA2@postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Log Message:
-----------
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".
Modified Files:
--------------
pgsql/src/backend/parser:
parse_clause.c (r1.146 -> r1.147)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parse_clause.c.diff?r1=1.146&r2=1.147)
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2006-03-06 04:45:21 | pgsql: In psql, save history of backslash commands used in multi-line |
Previous Message | Bruce Momjian | 2006-03-05 20:38:27 | Re: pgsql: Add: > o Port contrib/xml2 |