pgsql: Allow to push down clauses from HAVING to WHERE when grouping se

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow to push down clauses from HAVING to WHERE when grouping se
Date: 2015-07-26 15:12:37
Message-ID: E1ZJNbR-0004O7-EN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)fsf(at)news-spur(dot)riddles(dot)org(dot)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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2015-07-26 15:12:40 pgsql: Allow to push down clauses from HAVING to WHERE when grouping se
Previous Message Heikki Linnakangas 2015-07-26 07:49:37 Re: pgsql: Replace our hacked version of ax_pthread.m4 with latest upstream