pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix overeager pushdown of HAVING clauses when grouping sets are
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix overeager pushdown of HAVING clauses when grouping sets are
@ 2016-02-08 10:06 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2016-02-08 10:06 UTC (permalink / raw)
  To: pgsql-committers

Fix overeager pushdown of HAVING clauses when grouping sets are used.

In 61444bfb we started to allow HAVING clauses to be fully pushed down
into WHERE, even when grouping sets are in use. That turns out not to
work correctly, because grouping sets can "produce" NULLs, meaning that
filtering in WHERE and HAVING can have different results, even when no
aggregates or volatile functions are involved.

Instead only allow pushdown of empty grouping sets.

It'd be nice to do better, but the exact mechanics of deciding which
cases are safe are still being debated. It's important to give correct
results till we find a good solution, and such a solution might not be
appropriate for backpatching anyway.

Bug: #13863
Reported-By: 'wrb'
Diagnosed-By: Dean Rasheed
Author: Andrew Gierth
Reviewed-By: Dean Rasheed and Andres Freund
Discussion: 20160113183558.12989.56904@wrigleys.postgresql.org
Backpatch: 9.5, where grouping sets were introduced

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a6897efab92bc7e645b6c6d15274b8d61c53fe8f

Modified Files
--------------
src/backend/optimizer/plan/planner.c       | 23 ++++++++-----
src/test/regress/expected/groupingsets.out | 54 ++++++++++++++++++++++++++++++
src/test/regress/sql/groupingsets.sql      | 12 +++++++
3 files changed, 81 insertions(+), 8 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: Fix overeager pushdown of HAVING clauses when grouping sets are
@ 2016-02-08 10:06 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2016-02-08 10:06 UTC (permalink / raw)
  To: pgsql-committers

Fix overeager pushdown of HAVING clauses when grouping sets are used.

In 61444bfb we started to allow HAVING clauses to be fully pushed down
into WHERE, even when grouping sets are in use. That turns out not to
work correctly, because grouping sets can "produce" NULLs, meaning that
filtering in WHERE and HAVING can have different results, even when no
aggregates or volatile functions are involved.

Instead only allow pushdown of empty grouping sets.

It'd be nice to do better, but the exact mechanics of deciding which
cases are safe are still being debated. It's important to give correct
results till we find a good solution, and such a solution might not be
appropriate for backpatching anyway.

Bug: #13863
Reported-By: 'wrb'
Diagnosed-By: Dean Rasheed
Author: Andrew Gierth
Reviewed-By: Dean Rasheed and Andres Freund
Discussion: 20160113183558.12989.56904@wrigleys.postgresql.org
Backpatch: 9.5, where grouping sets were introduced

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/87dbc72a79bbd84aaba3a8c543a093106392da8d

Modified Files
--------------
src/backend/optimizer/plan/planner.c       | 23 ++++++++-----
src/test/regress/expected/groupingsets.out | 54 ++++++++++++++++++++++++++++++
src/test/regress/sql/groupingsets.sql      | 12 +++++++
3 files changed, 81 insertions(+), 8 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:[~2016-02-08 10:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-02-08 10:06 pgsql: Fix overeager pushdown of HAVING clauses when grouping sets are Andres Freund <andres@anarazel.de>
2016-02-08 10:06 pgsql: Fix overeager pushdown of HAVING clauses when grouping sets are 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