Support unlogged GiST index.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 11 Feb 2013 20:50:15 +0000 (22:50 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 11 Feb 2013 21:07:09 +0000 (23:07 +0200)
commit62401db45c4feff9be296fa78a8bb7b9947d69de
tree5d572267b5a2eae75049ba720bc1faf9f6a6694d
parentb669f416cee77ef9025b80f9c4201688578447d1
Support unlogged GiST index.

The reason this wasn't supported before was that GiST indexes need an
increasing sequence to detect concurrent page-splits. In a regular WAL-
logged GiST index, the LSN of the page-split record is used for that
purpose, and in a temporary index, we can get away with a backend-local
counter. Neither of those methods works for an unlogged relation.

To provide such an increasing sequence of numbers, create a "fake LSN"
counter that is saved and restored across shutdowns. On recovery, unlogged
relations are blown away, so the counter doesn't need to survive that
either.

Jeevan Chalke, based on discussions with Robert Haas, Tom Lane and me.
12 files changed:
doc/src/sgml/ref/create_table.sgml
src/backend/access/gist/gist.c
src/backend/access/gist/gistbuild.c
src/backend/access/gist/gistutil.c
src/backend/access/gist/gistvacuum.c
src/backend/access/transam/xlog.c
src/backend/storage/buffer/bufmgr.c
src/bin/pg_controldata/pg_controldata.c
src/bin/pg_resetxlog/pg_resetxlog.c
src/include/access/gist_private.h
src/include/access/xlog.h
src/include/catalog/pg_control.h