postgresql/src/backend/access
Heikki Linnakangas 9155580fd5 Generate less WAL during GiST, GIN and SP-GiST index build.
Instead of WAL-logging every modification during the build separately,
first build the index without any WAL-logging, and make a separate pass
through the index at the end, to write all pages to the WAL. This
significantly reduces the amount of WAL generated, and is usually also
faster, despite the extra I/O needed for the extra scan through the index.
WAL generated this way is also faster to replay.

For GiST, the LSN-NSN interlock makes this a little tricky. All pages must
be marked with a valid (i.e. non-zero) LSN, so that the parent-child
LSN-NSN interlock works correctly. We now use magic value 1 for that during
index build. Change the fake LSN counter to begin from 1000, so that 1 is
safely smaller than any real or fake LSN. 2 would've been enough for our
purposes, but let's reserve a bigger range, in case we need more special
values in the future.

Author: Anastasia Lubennikova, Andrey V. Lepikhov
Reviewed-by: Heikki Linnakangas, Dmitry Dolgov
2019-04-03 17:03:15 +03:00
..
brin Report progress of CREATE INDEX operations 2019-04-02 15:18:08 -03:00
common Generated columns 2019-03-30 08:15:57 +01:00
gin Generate less WAL during GiST, GIN and SP-GiST index build. 2019-04-03 17:03:15 +03:00
gist Generate less WAL during GiST, GIN and SP-GiST index build. 2019-04-03 17:03:15 +03:00
hash Report progress of CREATE INDEX operations 2019-04-02 15:18:08 -03:00
heap Correctly initialize newly added struct member 2019-04-03 09:58:47 -03:00
index Compute XID horizon for page level index vacuum on primary. 2019-03-26 16:52:54 -07:00
nbtree Report progress of CREATE INDEX operations 2019-04-02 15:18:08 -03:00
rmgrdesc Generate less WAL during GiST, GIN and SP-GiST index build. 2019-04-03 17:03:15 +03:00
spgist Generate less WAL during GiST, GIN and SP-GiST index build. 2019-04-03 17:03:15 +03:00
table tableam: bitmap table scan. 2019-03-31 18:37:57 -07:00
tablesample tableam: sample scan. 2019-03-31 18:37:57 -07:00
transam Generate less WAL during GiST, GIN and SP-GiST index build. 2019-04-03 17:03:15 +03:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00