pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow to push down clauses from HAVING to WHERE when grouping se
2+ messages / 1 participants
[nested] [flat]

* pgsql: Allow to push down clauses from HAVING to WHERE when grouping se
@ 2015-07-26 15:12 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2015-07-26 15:12 UTC (permalink / raw)
  To: pgsql-committers

Allow to push down clauses from HAVING to WHERE when grouping sets are used.

Previously we disallowed pushing down quals to WHERE in the presence of
grouping sets. That's overly restrictive.

We now instead copy quals to WHERE if applicable, leaving the
one in HAVING in place. That's because, at that stage of the planning
process, it's nontrivial to determine if it's safe to remove the one in
HAVING.

Author: Andrew Gierth
Discussion: 874mkt3l59.fsf@news-spur.riddles.org.uk
Backpatch: 9.5, where grouping sets were introduced. This isn't exactly
    a bugfix, but it seems better to keep the branches in sync at this point.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/61444bfb809d3a088a270a59f383af3d4cd157b0

Modified Files
--------------
src/backend/optimizer/plan/planner.c |    5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Allow to push down clauses from HAVING to WHERE when grouping se
@ 2015-07-26 15:12 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2015-07-26 15:12 UTC (permalink / raw)
  To: pgsql-committers

Allow to push down clauses from HAVING to WHERE when grouping sets are used.

Previously we disallowed pushing down quals to WHERE in the presence of
grouping sets. That's overly restrictive.

We now instead copy quals to WHERE if applicable, leaving the
one in HAVING in place. That's because, at that stage of the planning
process, it's nontrivial to determine if it's safe to remove the one in
HAVING.

Author: Andrew Gierth
Discussion: 874mkt3l59.fsf@news-spur.riddles.org.uk
Backpatch: 9.5, where grouping sets were introduced. This isn't exactly
    a bugfix, but it seems better to keep the branches in sync at this point.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/29e4455d7139d0b1bf8d3b62e566e7bb20cf0ec6

Modified Files
--------------
src/backend/optimizer/plan/planner.c |    5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-07-26 15:12 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-26 15:12 pgsql: Allow to push down clauses from HAVING to WHERE when grouping se Andres Freund <andres@anarazel.de>
2015-07-26 15:12 pgsql: Allow to push down clauses from HAVING to WHERE when grouping se Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox