postgresql/contrib
Heikki Linnakangas 8af2565248 Introduce a new smgr bulk loading facility.
The new facility makes it easier to optimize bulk loading, as the
logic for buffering, WAL-logging, and syncing the relation only needs
to be implemented once. It's also less error-prone: We have had a
number of bugs in how a relation is fsync'd - or not - at the end of a
bulk loading operation. By centralizing that logic to one place, we
only need to write it correctly once.

The new facility is faster for small relations: Instead of of calling
smgrimmedsync(), we register the fsync to happen at next checkpoint,
which avoids the fsync latency. That can make a big difference if you
are e.g. restoring a schema-only dump with lots of relations.

It is also slightly more efficient with large relations, as the WAL
logging is performed multiple pages at a time. That avoids some WAL
header overhead. The sorted GiST index build did that already, this
moves the buffering to the new facility.

The changes to pageinspect GiST test needs an explanation: Before this
patch, the sorted GiST index build set the LSN on every page to the
special GistBuildLSN value, not the LSN of the WAL record, even though
they were WAL-logged. There was no particular need for it, it just
happened naturally when we wrote out the pages before WAL-logging
them. Now we WAL-log the pages first, like in B-tree build, so the
pages are stamped with the record's real LSN. When the build is not
WAL-logged, we still use GistBuildLSN. To make the test output
predictable, use an unlogged index.

Reviewed-by: Andres Freund
Discussion: https://www.postgresql.org/message-id/30e8f366-58b3-b239-c521-422122dd5150%40iki.fi
2024-02-23 16:10:51 +02:00
..
adminpack Update copyright for 2024 2024-01-03 20:49:05 -05:00
amcheck Update copyright for 2024 2024-01-03 20:49:05 -05:00
auth_delay Update copyright for 2024 2024-01-03 20:49:05 -05:00
auto_explain Add EXPLAIN (MEMORY) to report planner memory consumption 2024-01-29 17:53:03 +01:00
basebackup_to_shell Update copyright for 2024 2024-01-03 20:49:05 -05:00
basic_archive Update copyright for 2024 2024-01-03 20:49:05 -05:00
bloom Update copyright for 2024 2024-01-03 20:49:05 -05:00
bool_plperl Update copyright for 2024 2024-01-03 20:49:05 -05:00
btree_gin Update copyright for 2024 2024-01-03 20:49:05 -05:00
btree_gist Fix comment on gist_stratnum_btree 2024-01-25 07:25:10 +01:00
citext Update copyright for 2024 2024-01-03 20:49:05 -05:00
cube Update copyright for 2024 2024-01-03 20:49:05 -05:00
dblink Make dblink interruptible, via new libpqsrv APIs. 2024-01-08 11:39:56 -08:00
dict_int Update copyright for 2024 2024-01-03 20:49:05 -05:00
dict_xsyn Update copyright for 2024 2024-01-03 20:49:05 -05:00
earthdistance Update copyright for 2024 2024-01-03 20:49:05 -05:00
file_fdw Update copyright for 2024 2024-01-03 20:49:05 -05:00
fuzzystrmatch Update copyright for 2024 2024-01-03 20:49:05 -05:00
hstore Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
hstore_plperl Update copyright for 2024 2024-01-03 20:49:05 -05:00
hstore_plpython Update copyright for 2024 2024-01-03 20:49:05 -05:00
intagg Update copyright for 2024 2024-01-03 20:49:05 -05:00
intarray Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
isn Update copyright for 2024 2024-01-03 20:49:05 -05:00
jsonb_plperl Update copyright for 2024 2024-01-03 20:49:05 -05:00
jsonb_plpython Update copyright for 2024 2024-01-03 20:49:05 -05:00
lo Update copyright for 2024 2024-01-03 20:49:05 -05:00
ltree Update copyright for 2024 2024-01-03 20:49:05 -05:00
ltree_plpython Update copyright for 2024 2024-01-03 20:49:05 -05:00
oid2name Update copyright for 2024 2024-01-03 20:49:05 -05:00
pageinspect Introduce a new smgr bulk loading facility. 2024-02-23 16:10:51 +02:00
passwordcheck Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_buffercache Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_freespacemap Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_prewarm Replace calls to pg_qsort() with the qsort() macro. 2024-02-16 11:37:50 -06:00
pg_stat_statements Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
pg_surgery Error message capitalisation 2024-01-18 09:35:12 +01:00
pg_trgm Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
pg_visibility Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_walinspect Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgcrypto pgcrypto: Fix incorrect argument vs PG_GETARG*() mappings 2024-02-14 08:59:05 +09:00
pgrowlocks Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgstattuple Update copyright for 2024 2024-01-03 20:49:05 -05:00
postgres_fdw Pull up ANY-SUBLINK with the necessary lateral support. 2024-02-15 12:06:12 +02:00
seg seg: Add test "security" in meson.build 2024-01-18 10:12:44 +09:00
sepgsql Update copyright for 2024 2024-01-03 20:49:05 -05:00
spi Update copyright for 2024 2024-01-03 20:49:05 -05:00
sslinfo Update copyright for 2024 2024-01-03 20:49:05 -05:00
start-scripts Remove gratuitous references to postmaster program 2023-01-26 10:48:32 +01:00
tablefunc Update copyright for 2024 2024-01-03 20:49:05 -05:00
tcn Update copyright for 2024 2024-01-03 20:49:05 -05:00
test_decoding Add a slot synchronization function. 2024-02-14 09:45:36 +05:30
tsm_system_rows Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsm_system_time Update copyright for 2024 2024-01-03 20:49:05 -05:00
unaccent Update copyright for 2024 2024-01-03 20:49:05 -05:00
uuid-ossp Update copyright for 2024 2024-01-03 20:49:05 -05:00
vacuumlo Update copyright for 2024 2024-01-03 20:49:05 -05:00
xml2 Fix incompatibilities with libxml2 >= 2.12.0. 2024-01-29 12:06:13 -05:00
contrib-global.mk
Makefile Remove the "snapshot too old" feature. 2023-09-05 19:53:43 +12:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
README

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.