postgresql/contrib
Richard Guo e01b23b84e Add an enable_groupagg GUC parameter
We've long had enable_hashagg to discourage hashed aggregation, but
there was no equivalent for grouping that works by reading presorted
input.  That's handy when investigating planner cost misestimates, and
as an escape hatch when a sorted grouping plan is chosen over a much
cheaper hashed one.

enable_groupagg (on by default) covers the GroupAggregate and Group
nodes, the sort-based Unique step used for DISTINCT and semijoin
unique-ification, and the sorted mode of SetOp.  It isn't a hard
switch; it only bumps disabled_nodes, so plans with no other choice
are still produced.

Several regression and module tests had been setting enable_sort off,
and one enable_indexscan off, only to force a hashed plan.  Use
enable_groupagg there instead, where that was the real intent.  In
union.sql this also lets us test the hashed UNION path, which we had
no way to reach before.

Author: Tatsuro Yamada <yamatattsu@gmail.com>
Co-authored-by: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAOKkKFvYHSEsFazkrf9bRH14p-H27XMaqbZfRYjS6EHBruvZMQ@mail.gmail.com
2026-07-09 09:44:56 +09:00
..
amcheck amcheck: Fix memory leak with gin_index_check() 2026-07-06 09:32:25 +09:00
auth_delay Update copyright for 2026 2026-01-01 13:24:10 -05:00
auto_explain Pre-beta mechanical code beautification, step 2: run pgperltidy. 2026-05-13 10:37:42 -04:00
basebackup_to_shell Update copyright for 2026 2026-01-01 13:24:10 -05:00
basic_archive Fix dereference in a couple of GUC check hooks 2026-03-24 16:45:39 +01:00
bloom Discount the metapage when estimating number of index pages visited. 2026-03-20 14:50:53 -04:00
bool_plperl Update copyright for 2026 2026-01-01 13:24:10 -05:00
btree_gin Use fallthrough attribute instead of comment 2026-02-19 08:51:12 +01:00
btree_gist Remove btree_gist's useless logic for encoding-aware truncation. 2026-07-03 15:31:58 -04:00
citext Update copyright for 2026 2026-01-01 13:24:10 -05:00
cube Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
dblink Run pgperltidy 2026-06-29 15:27:44 -04:00
dict_int Update copyright for 2026 2026-01-01 13:24:10 -05:00
dict_xsyn Simplify dxsyn_lexize(). 2026-07-05 16:22:40 -04:00
earthdistance Update copyright for 2026 2026-01-01 13:24:10 -05:00
file_fdw file_fdw: Add regression test for file_fdw with ON_ERROR='set_null' 2026-03-16 12:13:11 +09:00
fuzzystrmatch Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
hstore Add an enable_groupagg GUC parameter 2026-07-09 09:44:56 +09:00
hstore_plperl hstore_plperl: Add CHECK_FOR_INTERRUPTS() in reference-unwinding loop. 2026-06-18 12:23:13 -04:00
hstore_plpython plpython: Fix NULL pointer dereferences for broken sequence and mapping objects 2026-06-29 11:38:39 +09:00
intagg Update copyright for 2026 2026-01-01 13:24:10 -05:00
intarray Fix missed ReleaseVariableStats() in intarray's _int_matchsel(). 2026-05-25 18:15:49 -04:00
isn Pre-beta mechanical code beautification, step 1: run pgindent. 2026-05-13 10:34:17 -04:00
jsonb_plperl jsonb_plperl, jsonb_plpython: Fix unguarded recursion and loops. 2026-06-17 11:04:41 -04:00
jsonb_plpython plpython: Fix NULL pointer dereferences for broken sequence and mapping objects 2026-06-29 11:38:39 +09:00
lo Update copyright for 2026 2026-01-01 13:24:10 -05:00
ltree Add an enable_groupagg GUC parameter 2026-07-09 09:44:56 +09:00
ltree_plpython Change StaticAssertVariableIsOfType to be a declaration 2026-02-03 08:46:02 +01:00
oid2name Fix mismatched deallocation functions 2026-07-01 13:50:08 +02:00
pageinspect Fix more Datum conversion inconsistencies 2026-07-08 13:22:50 +09:00
passwordcheck Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_buffercache pg_buffercache: restore rowtype verification in pg_buffercache_pages() 2026-06-10 12:32:59 +09:00
pg_freespacemap Update copyright for 2026 2026-01-01 13:24:10 -05:00
pg_logicalinspect Fix more Datum conversion inconsistencies 2026-07-08 13:22:50 +09:00
pg_overexplain Tighten nullingrels checks for outer joins 2026-07-08 12:02:21 +09:00
pg_plan_advice Use PG_MODULE_MAGIC_EXT in newly introduced modules 2026-07-06 15:45:58 -04:00
pg_prewarm Fix out-of-bounds access in autoprewarm worker 2026-06-26 19:47:36 +02:00
pg_stash_advice Use PG_MODULE_MAGIC_EXT in newly introduced modules 2026-07-06 15:45:58 -04:00
pg_stat_statements pg_stat_statements: Set PlannedStmt to NULL after nested utility execution 2026-05-13 15:39:44 +09:00
pg_surgery pg_surgery: Fix off-by-one bug with heap offset 2026-06-06 08:16:36 +09:00
pg_trgm Avoid casting void * function arguments 2026-04-23 08:08:57 +02:00
pg_visibility Revert "Allow logical replication snapshots to be database-specific" 2026-05-23 21:33:19 -07:00
pg_walinspect Fix more Datum conversion inconsistencies 2026-07-08 13:22:50 +09:00
pgcrypto pgcrypto: avoid recursive ResourceOwnerForget(). 2026-06-22 12:59:16 -04:00
pgrowlocks Thread flags through begin-scan APIs 2026-03-30 12:27:24 -04:00
pgstattuple Fix more Datum conversion inconsistencies 2026-07-08 13:22:50 +09:00
postgres_fdw postgres_fdw: Report ANALYZE to pgstats after importing statistics. 2026-07-07 18:40:00 +09:00
seg Improve the names generated for indexes on expressions. 2026-07-01 11:33:52 -04:00
sepgsql Harmonize function parameter names for Postgres 19. 2026-04-22 12:47:19 -04:00
spi Remove the refint extension. 2026-07-08 16:22:12 -05:00
sslinfo Fix compilation with OpenSSL 4 2026-05-29 21:52:35 +02:00
start-scripts Remove gratuitous references to postmaster program 2023-01-26 10:48:32 +01:00
tablefunc Avoid including vacuum.h in tableam.h and heapam.h. 2026-03-31 12:43:52 -05:00
tcn Update copyright for 2026 2026-01-01 13:24:10 -05:00
test_decoding Disallow direct use of the pgrepack logical decoding plugin 2026-06-09 20:12:55 +02:00
tsm_system_rows Update copyright for 2026 2026-01-01 13:24:10 -05:00
tsm_system_time Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
unaccent Update Unicode data to Unicode 17.0.0 2026-03-20 08:42:50 +01:00
uuid-ossp Fix accidentally cast away qualifiers 2026-01-26 16:02:31 +01:00
vacuumlo Update copyright for 2026 2026-01-01 13:24:10 -05:00
xml2 xml2: Fix crash with namespace nodes in xpath_nodeset() 2026-06-11 14:29:18 +09:00
contrib-global.mk Respect TEMP_CONFIG when pg_regress_check and friends are called 2016-02-27 12:28:21 -05:00
Makefile Add pg_stash_advice contrib module. 2026-04-06 07:41:28 -04:00
meson.build Add pg_stash_advice contrib module. 2026-04-06 07:41:28 -04:00
README Rename 'gmake' to 'make' in docs and recommended commands 2014-02-12 17:29:19 -05:00

The PostgreSQL contrib tree
---------------------------

This subtree contains porting tools, analysis utilities, and plug-in
features that are not part of the core PostgreSQL system, mainly
because they address a limited audience or are too experimental to be
part of the main source tree.  This does not preclude their
usefulness.

User documentation for each module appears in the main SGML
documentation.

When building from the source distribution, these modules are not
built automatically, unless you build the "world" target.  You can
also build and install them all by running "make all" and "make
install" in this directory; or to build and install just one selected
module, do the same in that module's subdirectory.

Some directories supply new user-defined functions, operators, or
types.  To make use of one of these modules, after you have installed
the code you need to register the new SQL objects in the database
system by executing a CREATE EXTENSION command.  In a fresh database,
you can simply do

    CREATE EXTENSION module_name;

See the PostgreSQL documentation for more information about this
procedure.