postgresql/src/test
Tomas Vondra b437571714 Allow parallel CREATE INDEX for BRIN indexes
Allow using multiple worker processes to build BRIN index, which until
now was supported only for BTREE indexes. For large tables this often
results in significant speedup when the build is CPU-bound.

The work is split in a simple way - each worker builds BRIN summaries on
a subset of the table, determined by the regular parallel scan used to
read the data, and feeds them into a shared tuplesort which sorts them
by blkno (start of the range). The leader then reads this sorted stream
of ranges, merges duplicates (which may happen if the parallel scan does
not align with BRIN pages_per_range), and adds the resulting ranges into
the index.

The number of duplicate results produced by workers (requiring merging
in the leader process) should be fairly small, thanks to how parallel
scans assign chunks to workers. The likelihood of duplicate results may
increase for higher pages_per_range values, but then there are fewer
page ranges in total. In any case, we expect the merging to be much
cheaper than summarization, so this should be a win.

Most of the parallelism infrastructure is a simplified copy of the code
used by BTREE indexes, omitting the parts irrelevant for BRIN indexes
(e.g. uniqueness checks).

This also introduces a new index AM flag amcanbuildparallel, determining
whether to attempt to start parallel workers for the index build.

Original patch by me, with reviews and substantial reworks by Matthias
van de Meent, certainly enough to make him a co-author.

Author: Tomas Vondra, Matthias van de Meent
Reviewed-by: Matthias van de Meent
Discussion: https://postgr.es/m/c2ee7d69-ce17-43f2-d1a0-9811edbda6e6%40enterprisedb.com
2023-12-08 18:15:26 +01:00
..
authentication Allow tests to pass in OpenSSL FIPS mode (TAP tests) 2023-11-17 16:52:46 +01:00
examples Remove distprep 2023-11-06 15:18:04 +01:00
icu Remove distprep 2023-11-06 15:18:04 +01:00
isolation Fix assertions with RI triggers in heap_update and heap_delete. 2023-11-28 12:00:14 +02:00
kerberos Remove distprep 2023-11-06 15:18:04 +01:00
ldap Remove distprep 2023-11-06 15:18:04 +01:00
locale Remove distprep 2023-11-06 15:18:04 +01:00
mb Fix MB regression tests for WAL-logging of hash indexes. 2017-03-15 07:25:36 -04:00
modules Allow parallel CREATE INDEX for BRIN indexes 2023-12-08 18:15:26 +01:00
perl Add option to specify timeout seconds to BackgroundPsql.pm. 2023-11-30 14:08:34 +09:00
recovery Remove distprep 2023-11-06 15:18:04 +01:00
regress Test that it works to RESET an invalid reloption 2023-12-08 11:58:58 +01:00
ssl Use BIO_{get,set}_app_data instead of BIO_{get,set}_data. 2023-11-28 12:34:03 -05:00
subscription Avoid unconditionally filling in missing values with NULL in pgoutput. 2023-11-27 08:49:55 +05:30
Makefile Refactor PG_TEST_EXTRA logic in autoconf build 2022-09-20 11:24:16 -07:00
README Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00

README

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication (but see also below)

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

kerberos/
  Tests for Kerberos/GSSAPI authentication and encryption

ldap/
  Tests for LDAP-based authentication

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication