Commit 45e67a2a authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix Gin README.

The README incorrectly claimed that GIN posting tree pages contain an array
of uncompressed items in addition to compressed posting lists. Earlier
versions of the GIN posting list compression patch worked that way, but not
the one that was committed.
parent 80ce90b9
...@@ -230,15 +230,12 @@ child page, as an ItemPointer. The right bound of the page is stored right ...@@ -230,15 +230,12 @@ child page, as an ItemPointer. The right bound of the page is stored right
after the page header, before the PostingItem array. after the page header, before the PostingItem array.
Posting tree leaf pages also use the standard PageHeader and opaque struct, Posting tree leaf pages also use the standard PageHeader and opaque struct,
and the right bound of the page is stored right after the page header, and the right bound of the page is stored right after the page header, but
but the page content comprises of 0-32 compressed posting lists, and an the page content comprises of a number of compressed posting lists. The
additional array of regular uncompressed item pointers. The compressed posting compressed posting lists are stored one after each other, between page header
lists are stored one after each other, between page header and pd_lower. The and pd_lower. The space between pd_lower and pd_upper is unused, which allows
uncompressed array is stored between pd_upper and pd_special. The space full-page images of posting tree leaf pages to skip the unused space in middle
between pd_lower and pd_upper is unused, which allows full-page images of (buffer_std = true in XLogRecData).
posting tree leaf pages to skip the unused space in middle (buffer_std = true
in XLogRecData). For historical reasons, this does not apply to internal
pages, or uncompressed leaf pages migrated from earlier versions.
The item pointers are stored in a number of independent compressed posting The item pointers are stored in a number of independent compressed posting
lists (also called segments), instead of one big one, to make random access lists (also called segments), instead of one big one, to make random access
...@@ -248,14 +245,6 @@ multiple lists, you can first skip over to the list containing the item you're ...@@ -248,14 +245,6 @@ multiple lists, you can first skip over to the list containing the item you're
looking for, and read only that segment. Also, an update only needs to looking for, and read only that segment. Also, an update only needs to
re-encode the affected segment. re-encode the affected segment.
The uncompressed items array is used for insertions, to avoid re-encoding
a compressed list on every update. If there is room on a page, an insertion
simply inserts the new item to the right place in the uncompressed array.
When a page becomes full, it is rewritten, merging all the uncompressed items
are into the compressed lists. When reading, the uncompressed array and the
compressed lists are read in tandem, and merged into one stream of sorted
item pointers.
Posting List Compression Posting List Compression
------------------------ ------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment