pgsql: Fix eager aggregation below volatile join clauses

Поиск
Список
Период
Сортировка
Искать

pgsql: Fix eager aggregation below volatile join clauses

От:
Richard Guo <rguo@postgresql.org>
Дата:
Fix eager aggregation below volatile join clauses

Eager aggregation could push a partial aggregation down to a relation
that is later joined using a join clause containing volatile
functions.  The clause is then evaluated once per group rather than
once per input row, which changes the number of times the function is
executed.

To fix, refuse to build grouped paths for a relation if any of its
join clauses contains volatile functions.

Back-patch to v19, where eager aggregation was introduced.

Author: shihao zhong 
Reviewed-by: Manu 
Discussion: https://postgr.es/m/CAGRkXqSc_qtpuPm34qoS1z0LVx4+Hc+JcJkbDEVC=z2ai4VQ1w@mail.gmail.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/27c844034f827b3910bc8a358780c6609ba87a41

Modified Files
--------------
src/backend/optimizer/util/relnode.c          | 13 +++++++++++++
src/test/regress/expected/eager_aggregate.out | 20 ++++++++++++++++++++
src/test/regress/sql/eager_aggregate.sql      |  7 +++++++
3 files changed, 40 insertions(+)

FAQ