]> granicus.if.org Git - postgresql/commit
Compress GIN posting lists, for smaller index size.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 22 Jan 2014 16:51:48 +0000 (18:51 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 22 Jan 2014 17:20:58 +0000 (19:20 +0200)
commit36a35c550ac114caa423bcbe339d3515db0cd957
tree3bd40801d0bc4ee3ac6ff668f9f2ae221aaada49
parent243ee266339bd4a049ff92e101010242169b7287
Compress GIN posting lists, for smaller index size.

GIN posting lists are now encoded using varbyte-encoding, which allows them
to fit in much smaller space than the straight ItemPointer array format used
before. The new encoding is used for both the lists stored in-line in entry
tree items, and in posting tree leaf pages.

To maintain backwards-compatibility and keep pg_upgrade working, the code
can still read old-style pages and tuples. Posting tree leaf pages in the
new format are flagged with GIN_COMPRESSED flag, to distinguish old and new
format pages. Likewise, entry tree tuples in the new format have a
GIN_ITUP_COMPRESSED flag set in a bit that was previously unused.

This patch bumps GIN_CURRENT_VERSION from 1 to 2. New indexes created with
version 9.4 will therefore have version number 2 in the metapage, while old
pg_upgraded indexes will have version 1. The code treats them the same, but
it might be come handy in the future, if we want to drop support for the
uncompressed format.

Alexander Korotkov and me. Reviewed by Tomas Vondra and Amit Langote.
13 files changed:
contrib/pgstattuple/expected/pgstattuple.out
src/backend/access/gin/README
src/backend/access/gin/ginbtree.c
src/backend/access/gin/gindatapage.c
src/backend/access/gin/ginentrypage.c
src/backend/access/gin/ginfast.c
src/backend/access/gin/ginget.c
src/backend/access/gin/gininsert.c
src/backend/access/gin/ginpostinglist.c
src/backend/access/gin/ginvacuum.c
src/backend/access/gin/ginxlog.c
src/backend/access/rmgrdesc/gindesc.c
src/include/access/gin_private.h