Fix volatile function evaluation in eager aggregation
Richard Guo <rguo@postgresql.org>
Fix volatile function evaluation in eager aggregation Pushing aggregates containing volatile functions below a join can violate volatility semantics by changing the number of times the function is executed. Here we check the Aggref nodes in the targetlist and havingQual for volatile functions and disable eager aggregation when such functions are present. Author: Richard Guo <guofenglinux@gmail.com> Reviewed-by: Matheus Alcantara <matheusssilv97@gmail.com> Discussion: https://postgr.es/m/CAMbWs48A53PY1Y4zoj7YhxPww9fO1hfnbdntKfA855zpXfVFRA@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/plan/initsplan.c | modified | +11 −0 |
| src/test/regress/expected/eager_aggregate.out | modified | +38 −0 |
| src/test/regress/sql/eager_aggregate.sql | modified | +14 −0 |
Discussion
- Eager aggregation, take 3 134 messages · 2024-03-04 → 2026-06-03