diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-02 00:48:44 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-02 00:48:44 +0000 |
commit | fb276438b61efc8d6b16ffbca03212305bbf7e84 (patch) | |
tree | d81efefaa244e77761f483d3721656651e7a0666 /doc/src | |
parent | 44f72c6e9e4e8c3d9c64fc606202b2c90ec1ceda (diff) |
Suppress useless searches for unused line pointers in PageAddItem. To do
this, add a 16-bit "flags" field to page headers by stealing some bits from
pd_tli. We use one flag bit as a hint to indicate whether there are any
unused line pointers; the remaining 15 are available for future use.
This is a cut-down form of an idea proposed by Hiroki Kataoka in July 2005.
At the time it was rejected because the original patch increased the size of
page headers and it wasn't clear that the benefit outweighed the distributed
cost. The flag-bit approach gets most of the benefit without requiring an
increase in the page header size.
Heikki Linnakangas and Tom Lane
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/storage.sgml | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/doc/src/sgml/storage.sgml b/doc/src/sgml/storage.sgml index c20b2ebfe1b..8a2e7929e62 100644 --- a/doc/src/sgml/storage.sgml +++ b/doc/src/sgml/storage.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/storage.sgml,v 1.14 2007/01/31 20:56:19 momjian Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/storage.sgml,v 1.15 2007/03/02 00:48:44 tgl Exp $ --> <chapter id="storage"> @@ -427,8 +427,8 @@ data. Empty in ordinary tables.</entry> The first 20 bytes of each page consists of a page header (PageHeaderData). Its format is detailed in <xref linkend="pageheaderdata-table">. The first two fields track the most - recent WAL entry related to this page. They are followed by three 2-byte - integer fields + recent WAL entry related to this page. Next is a 2-byte field + containing flag bits. This is followed by three 2-byte integer fields (<structfield>pd_lower</structfield>, <structfield>pd_upper</structfield>, and <structfield>pd_special</structfield>). These contain byte offsets from the page start to the start @@ -437,12 +437,13 @@ data. Empty in ordinary tables.</entry> The last 2 bytes of the page header, <structfield>pd_pagesize_version</structfield>, store both the page size and a version indicator. Beginning with - <productname>PostgreSQL</productname> 8.1 the version number is 3; + <productname>PostgreSQL</productname> 8.3 the version number is 4; + <productname>PostgreSQL</productname> 8.1 and 8.2 used version number 3; <productname>PostgreSQL</productname> 8.0 used version number 2; <productname>PostgreSQL</productname> 7.3 and 7.4 used version number 1; prior releases used version number 0. - (The basic page layout and header format has not changed in these versions, - but the layout of heap row headers has.) The page size + (The basic page layout and header format has not changed in most of these + versions, but the layout of heap row headers has.) The page size is basically only present as a cross-check; there is no support for having more than one page size in an installation. @@ -470,9 +471,15 @@ data. Empty in ordinary tables.</entry> </row> <row> <entry>pd_tli</entry> - <entry>TimeLineID</entry> - <entry>4 bytes</entry> - <entry>TLI of last change</entry> + <entry>uint16</entry> + <entry>2 bytes</entry> + <entry>TimeLineID of last change (only its lowest 16 bits)</entry> + </row> + <row> + <entry>pd_flags</entry> + <entry>uint16</entry> + <entry>2 bytes</entry> + <entry>Flag bits</entry> </row> <row> <entry>pd_lower</entry> |