]> granicus.if.org Git - postgresql/commit
Support parallel btree index builds.
authorRobert Haas <rhaas@postgresql.org>
Fri, 2 Feb 2018 18:25:55 +0000 (13:25 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 2 Feb 2018 18:32:44 +0000 (13:32 -0500)
commit9da0cc35284bdbe8d442d732963303ff0e0a40bc
tree7e2d9e8cf9e1d186cc7274b4daffd78325a81b66
parent9aef173163ae68c6b241e4c9bbb375c6baa71c60
Support parallel btree index builds.

To make this work, tuplesort.c and logtape.c must also support
parallelism, so this patch adds that infrastructure and then applies
it to the particular case of parallel btree index builds.  Testing
to date shows that this can often be 2-3x faster than a serial
index build.

The model for deciding how many workers to use is fairly primitive
at present, but it's better than not having the feature.  We can
refine it as we get more experience.

Peter Geoghegan with some help from Rushabh Lathia.  While Heikki
Linnakangas is not an author of this patch, he wrote other patches
without which this feature would not have been possible, and
therefore the release notes should possibly credit him as an author
of this feature.  Reviewed by Claudio Freire, Heikki Linnakangas,
Thomas Munro, Tels, Amit Kapila, me.

Discussion: http://postgr.es/m/CAM3SWZQKM=Pzc=CAHzRixKjp2eO5Q0Jg1SoFQqeXFQ647JiwqQ@mail.gmail.com
Discussion: http://postgr.es/m/CAH2-Wz=AxWqDoVvGU7dq856S4r6sJAj6DBn7VMtigkB33N5eyg@mail.gmail.com
51 files changed:
contrib/bloom/blinsert.c
doc/src/sgml/config.sgml
doc/src/sgml/monitoring.sgml
doc/src/sgml/ref/create_index.sgml
doc/src/sgml/ref/create_table.sgml
src/backend/access/brin/brin.c
src/backend/access/gin/gininsert.c
src/backend/access/gist/gistbuild.c
src/backend/access/hash/hash.c
src/backend/access/hash/hashsort.c
src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtsort.c
src/backend/access/spgist/spginsert.c
src/backend/access/transam/parallel.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/toasting.c
src/backend/commands/cluster.c
src/backend/commands/indexcmds.c
src/backend/executor/execParallel.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeSort.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/path/costsize.c
src/backend/optimizer/plan/planner.c
src/backend/postmaster/pgstat.c
src/backend/storage/file/buffile.c
src/backend/storage/file/fd.c
src/backend/utils/adt/orderedsetaggs.c
src/backend/utils/init/globals.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/probes.d
src/backend/utils/sort/logtape.c
src/backend/utils/sort/tuplesort.c
src/include/access/nbtree.h
src/include/access/parallel.h
src/include/access/relscan.h
src/include/catalog/index.h
src/include/miscadmin.h
src/include/nodes/execnodes.h
src/include/optimizer/paths.h
src/include/optimizer/planner.h
src/include/pgstat.h
src/include/storage/buffile.h
src/include/storage/fd.h
src/include/utils/logtape.h
src/include/utils/tuplesort.h
src/tools/pgindent/typedefs.list