pgsql: Per recent discussion on -hackers, we should sometimes reorder - Mailing list pgsql-committers

From neilc@postgresql.org (Neil Conway)
Subject pgsql: Per recent discussion on -hackers, we should sometimes reorder
Date
Msg-id 20060305213434.F03D79DCCA2@postgresql.org
Whole thread Raw
List 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)

pgsql-committers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: pgsql: Add: > o Port contrib/xml2
Next
From: momjian@postgresql.org (Bruce Momjian)
Date:
Subject: pgsql: In psql, save history of backslash commands used in multi-line