Go to file
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
config Remove distprep 2023-11-06 15:18:04 +01:00
contrib Allow parallel CREATE INDEX for BRIN indexes 2023-12-08 18:15:26 +01:00
doc Allow parallel CREATE INDEX for BRIN indexes 2023-12-08 18:15:26 +01:00
src Allow parallel CREATE INDEX for BRIN indexes 2023-12-08 18:15:26 +01:00
.cirrus.star Remove duplicate words in docs and code comments. 2023-10-09 09:18:47 +05:30
.cirrus.tasks.yml Use "template" data directory in tests 2023-08-24 14:38:02 -07:00
.cirrus.yml ci: Make compute resources for CI configurable 2023-08-23 15:15:28 -07:00
.dir-locals.el Make Emacs perl-mode indent more like perltidy. 2019-01-13 11:32:31 -08:00
.editorconfig Add .editorconfig 2019-12-18 09:13:13 +01:00
.git-blame-ignore-revs Add "Add trailing commas to enum definitions" to .git-blame-ignore-revs 2023-10-26 13:03:43 +02:00
.gitattributes Replace Gen_dummy_probes.sed with Gen_dummy_probes.pl 2023-11-14 10:27:10 +01:00
.gitignore Update top-level .gitignore. 2022-12-04 15:23:00 -05:00
COPYRIGHT Update copyright for 2023 2023-01-02 15:00:37 -05:00
GNUmakefile.in Remove distprep 2023-11-06 15:18:04 +01:00
HISTORY Canonicalize some URLs 2020-02-10 20:47:50 +01:00
Makefile Dynamically find correct installation docs in Makefile. 2022-01-19 14:48:25 +01:00
README README: remove duplicate download link & mention related softw. 2023-11-08 16:36:18 -05:00
README.git Canonicalize some URLs 2020-02-10 20:47:50 +01:00
aclocal.m4 autoconf: Move export_dynamic determination to configure 2022-12-06 18:55:28 -08:00
configure Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
configure.ac Optimize pg_readv/pg_pwritev single vector case. 2023-11-29 17:19:25 +13:00
meson.build Don't clean initdb files on template creation failure 2023-12-08 13:42:54 +01:00
meson_options.txt meson: Change default of 'selinux' feature option to auto 2023-11-17 10:23:02 -08:00

README

PostgreSQL Database Management System
=====================================

This directory contains the source code distribution of the PostgreSQL
database management system.

PostgreSQL is an advanced object-relational database management system
that supports an extended subset of the SQL standard, including
transactions, foreign keys, subqueries, triggers, user-defined types
and functions.  This distribution also contains C language bindings.

See the file INSTALL for instructions on how to build and install
PostgreSQL.  That file also lists supported operating systems and
hardware platforms and contains information regarding any other
software packages that are required to build or run the PostgreSQL
system.  Copyright and license information can be found in the
file COPYRIGHT.  A comprehensive documentation set is included in this
distribution; it can be read as described in the installation
instructions.

The latest version of this software, and related software, may be
obtained at https://www.postgresql.org/download/.  For more information
look at our web site located at https://www.postgresql.org/.