aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-10-14 17:23:01 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-10-14 17:23:46 -0400
commite6858e665731c0f56d3ecc9fbb245c32d24f8ef7 (patch)
tree4df2705d53d53b1bbd7a14d7017cb519d82ee227 /doc/src
parentdea95c7a7beb5ef66ce89269dd0e84d0c26e5523 (diff)
downloadpostgresql-e6858e665731c0f56d3ecc9fbb245c32d24f8ef7.tar.gz
postgresql-e6858e665731c0f56d3ecc9fbb245c32d24f8ef7.zip
Measure the number of all-visible pages for use in index-only scan costing.
Add a column pg_class.relallvisible to remember the number of pages that were all-visible according to the visibility map as of the last VACUUM (or ANALYZE, or some other operations that update pg_class.relpages). Use relallvisible/relpages, instead of an arbitrary constant, to estimate how many heap page fetches can be avoided during an index-only scan. This is pretty primitive and will no doubt see refinements once we've acquired more field experience with the index-only scan mechanism, but it's way better than using a constant. Note: I had to adjust an underspecified query in the window.sql regression test, because it was changing answers when the plan changed to use an index-only scan. Some of the adjacent tests perhaps should be adjusted as well, but I didn't do that here.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 0495bd03bd5..e830c5f3d44 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -1655,6 +1655,19 @@
</row>
<row>
+ <entry><structfield>relallvisible</structfield></entry>
+ <entry><type>int4</type></entry>
+ <entry></entry>
+ <entry>
+ Number of pages that are marked all-visible in the table's
+ visibility map. This is only an estimate used by the
+ planner. It is updated by <command>VACUUM</command>,
+ <command>ANALYZE</command>, and a few DDL commands such as
+ <command>CREATE INDEX</command>.
+ </entry>
+ </row>
+
+ <row>
<entry><structfield>reltoastrelid</structfield></entry>
<entry><type>oid</type></entry>
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>