pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Repair breakage of aggregate FILTER option.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Repair breakage of aggregate FILTER option.
@ 2017-10-16 19:24  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-10-16 19:24 UTC (permalink / raw)
  To: pgsql-committers

Repair breakage of aggregate FILTER option.

An aggregate's input expression(s) are not supposed to be evaluated
at all for a row where its FILTER test fails ... but commit 8ed3f11bb
overlooked that requirement.  Reshuffle so that aggregates having a
filter clause evaluate their arguments separately from those without.
This still gets the benefit of doing only one ExecProject in the
common case of multiple Aggrefs, none of which have filters.

While at it, arrange for filter clauses to be included in the common
ExecProject evaluation, thus perhaps buying a little bit even when
there are filters.

Back-patch to v10 where the bug was introduced.

Discussion: https://postgr.es/m/30065.1508161354@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c3dfe0fec01469b8a7de327303cad50ba8ed338a

Modified Files
--------------
src/backend/executor/nodeAgg.c           | 186 ++++++++++++++++++++-----------
src/include/nodes/execnodes.h            |   6 +-
src/test/regress/expected/aggregates.out |   6 +
src/test/regress/sql/aggregates.sql      |   2 +
4 files changed, 130 insertions(+), 70 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: Repair breakage of aggregate FILTER option.
@ 2017-10-16 19:24  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2017-10-16 19:24 UTC (permalink / raw)
  To: pgsql-committers

Repair breakage of aggregate FILTER option.

An aggregate's input expression(s) are not supposed to be evaluated
at all for a row where its FILTER test fails ... but commit 8ed3f11bb
overlooked that requirement.  Reshuffle so that aggregates having a
filter clause evaluate their arguments separately from those without.
This still gets the benefit of doing only one ExecProject in the
common case of multiple Aggrefs, none of which have filters.

While at it, arrange for filter clauses to be included in the common
ExecProject evaluation, thus perhaps buying a little bit even when
there are filters.

Back-patch to v10 where the bug was introduced.

Discussion: https://postgr.es/m/30065.1508161354@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/72e9cc9715098e5e2b8c49b5707d876632bea2d3

Modified Files
--------------
src/backend/executor/nodeAgg.c           | 186 ++++++++++++++++++++-----------
src/include/nodes/execnodes.h            |   6 +-
src/test/regress/expected/aggregates.out |   6 +
src/test/regress/sql/aggregates.sql      |   2 +
4 files changed, 130 insertions(+), 70 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:[~2017-10-16 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 19:24 pgsql: Repair breakage of aggregate FILTER option. Tom Lane <tgl@sss.pgh.pa.us>
2017-10-16 19:24 pgsql: Repair breakage of aggregate FILTER option. Tom Lane <tgl@sss.pgh.pa.us>

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