{"Entry":{"collection":"guc","key":"enable_eager_aggregate","name":"enable_eager_aggregate","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Query Tuning / Planner Method Configuration","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"18","status":"added","to":"19"}],"content_hash":"620d5a04733023fd72b462536d34ac5ee6e9266a0aa1a31f5c47445f85899b58","context":"","default_changed_in":[],"default_history":[{"from":"19","to":"19","value":"on"}],"editorial":{"advice":{"olap":"Test joins with meaningful pre-aggregation opportunities, stale and fresh statistics, and spill pressure. Compare total CPU, peak memory, intermediate rows, and parallel plans, not just one query's elapsed time.","oltp":"Use a session-level experiment with EXPLAIN (ANALYZE, BUFFERS) and a representative parameter distribution. Keep the default unless eager aggregation consistently reduces rows and latency without plan instability.","small":"Leave planner switches and thresholds at their defaults until a repeatable regression is isolated. Fix cardinality statistics first; forcing a path globally can trade one improvement for many regressions."},"mechanism":["PostgreSQL describes enable_eager_aggregate as follows: “Enables eager aggregation.” It can be changed per session, which makes plan or behavior comparisons possible without changing every workload. The atlas measures it in PG19 Beta 3; boot_val is the compiled or initialized baseline, not proof of a running cluster's effective setting.","Eager aggregation partially pushes aggregation below a join so fewer rows may cross the join, then finalizes the result after all relations are joined. It is considered only when estimated average group size reaches min_eager_agg_group_size; estimates, grouping semantics, memory, and alternative join paths still determine whether the planner selects it.","Read it together with min_eager_agg_group_size, enable_hashagg, enable_partitionwise_aggregate, work_mem. Check SHOW and pg_settings on the target server, verify the source and pending_restart fields, and compare workload, logs, and resource metrics before and after any change."],"pitfalls":["Treating the measured boot_val for enable_eager_aggregate as proof of the effective value on an initialized or managed cluster.","Applying a change as though it were immediate while pg_settings reports user context.","Changing this setting in isolation without checking the linked limits, observability, and rollback path.","Depending on beta behavior in production without retesting the PostgreSQL 19 final release."],"references":[{"title":"PostgreSQL 19 Beta 4: enable_eager_aggregate","url":"https://www.postgresql.org/docs/19/runtime-config-query.html#GUC-ENABLE-EAGER-AGGREGATE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["min_eager_agg_group_size","enable_hashagg","enable_partitionwise_aggregate","work_mem","hash_mem_multiplier"],"summary":"enable_eager_aggregate — Enables eager aggregation. Observed in PG19 Beta 4; its last measured boot default is on in PG19 Beta 4, with user context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"19","group":"Query Tuning","group_slug":"query","imported_at":"2026-09-27T17:57:31.176847+08:00","intro_commit":{"authored_at":"2025-10-08T17:04:23+09:00","discussion":["https://postgr.es/m/CAMbWs48jzLrPt1J_00ZcPZXWUQKawQOFE8ROc-ADiYqsqrpBNw@mail.gmail.com"],"hash":"8e11859102f947e6145acdd809e5cdcdfbe90fa5","subject":"Implement Eager Aggregation","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=8e11859102f947e6145acdd809e5cdcdfbe90fa5"},"key":"enable_eager_aggregate","last_version":"20","max_val":"","min_val":"","name":"enable_eager_aggregate","position":115,"present_in":["19","20"],"short_desc":"Enables or disables the query planner's ability to partially push aggregation past a join, and finalize it once all the relations are joined.","short_desc_zh":"","source_rev":"english-manuals:5216d948d2677cfd6d9ebb00e09de82e17ede7c066bd2a32ed298679d200f9ce","unit":"","vartype":"bool"}},"Definition":{"Collection":"guc","Key":"enable_eager_aggregate","SourceDatabase":"center","Version":"20","SourceTable":"guc","SourceKey":"enable_eager_aggregate","SourceRevision":"english-manuals:5216d948d2677cfd6d9ebb00e09de82e17ede7c066bd2a32ed298679d200f9ce","Facts":{"boot_val":null,"category":"Planner Method Configuration","context":"","description":"Enables or disables the query planner's ability to partially push aggregation past a join, and finalize it once all the relations are joined. The default is on.","doc":{"anchor":"GUC-ENABLE-EAGER-AGGREGATE","file":"runtime-config-query.html","lang":"en","sha256":"b1924406a35080229d441ff86175b07b92e941bcc07afd9d4113917e14aa3dec","slug":"devel"},"documented":true,"enumvals":[],"extra_desc":"","lang":"en","max_val":null,"metadata_version":"","min_val":null,"name":"enable_eager_aggregate","short_desc":"","source":"english-manual","unit":"","vartype":"bool"},"ManualEvidence":{"doc":{"anchor":"GUC-ENABLE-EAGER-AGGREGATE","file":"runtime-config-query.html","lang":"en","sha256":"b1924406a35080229d441ff86175b07b92e941bcc07afd9d4113917e14aa3dec","slug":"devel"}},"MeasuredEvidence":{"metadata_version":""}},"Text":{"Collection":"guc","Key":"enable_eager_aggregate","SourceDatabase":"center","Version":"20","Locale":"en","Title":"enable_eager_aggregate","Summary":"Enables or disables the query planner's ability to partially push aggregation past a join, and finalize it once all the relations are joined. The default is on.","BodyHTML":"\u003cp\u003eEnables or disables the query planner\u0026#39;s ability to partially push aggregation past a join, and finalize it once all the relations are joined. The default is on.\u003c/p\u003e","SourceRevision":"english-manuals:5216d948d2677cfd6d9ebb00e09de82e17ede7c066bd2a32ed298679d200f9ce","ContentHash":"004f5bb134f7a18091b6ce7d8add98f10a00aab9c1ace6d62037321f4a419e8f","Payload":{"description":"Enables or disables the query planner's ability to partially push aggregation past a join, and finalize it once all the relations are joined. The default is on."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
