summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-02-15 21:01:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-02-15 21:01:39 +0000
commitf0c9397f808531b4207ebe60ff3ba9b038812443 (patch)
tree66d756d316f0d045dd6d0a756315efb6ed99b878 /doc/src
parent4b8f1259738458e35a147820232bc7aab4f85e5c (diff)
First steps towards statistics on expressional (nee functional) indexes.
This commit teaches ANALYZE to store such stats in pg_statistic, but nothing is done yet about teaching the planner to use 'em. Also, repair longstanding oversight in separate ANALYZE command: it updated the pg_class.relpages and reltuples counts for the table proper, but not for indexes.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/catalogs.sgml21
1 files changed, 15 insertions, 6 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml
index 4baae556b31..196fdc6efdd 100644
--- a/doc/src/sgml/catalogs.sgml
+++ b/doc/src/sgml/catalogs.sgml
@@ -1,6 +1,6 @@
<!--
Documentation of the system catalogs, directed toward PostgreSQL developers
- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.83 2004/02/12 23:41:00 tgl Exp $
+ $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.84 2004/02/15 21:01:38 tgl Exp $
-->
<chapter id="catalogs">
@@ -3068,8 +3068,8 @@
</indexterm>
<para>
- The catalog <structname>pg_statistic</structname> stores statistical data about
- the contents of the database. Entries are created by
+ The catalog <structname>pg_statistic</structname> stores statistical data
+ about the contents of the database. Entries are created by
<command>ANALYZE</command> and subsequently used by the query planner.
There is one entry for each table column that has been analyzed.
Note that all the statistical data is inherently approximate,
@@ -3077,13 +3077,22 @@
</para>
<para>
+ <structname>pg_statistic</structname> also stores statistical data about
+ the values of index expressions. These are described as if they were
+ actual data columns; in particular, <structfield>starelid</structfield>
+ references the index. No entry is made for an ordinary non-expression
+ index column, however, since it would be redundant with the entry
+ for the underlying table column.
+ </para>
+
+ <para>
Since different kinds of statistics may be appropriate for different
kinds of data, <structname>pg_statistic</structname> is designed not
to assume very much about what sort of statistics it stores. Only
extremely general statistics (such as nullness) are given dedicated
columns in <structname>pg_statistic</structname>. Everything else
- is stored in <quote>slots</quote>, which are groups of associated columns whose
- content is identified by a code number in one of the slot's columns.
+ is stored in <quote>slots</quote>, which are groups of associated columns
+ whose content is identified by a code number in one of the slot's columns.
For more information see
<filename>src/include/catalog/pg_statistic.h</filename>.
</para>
@@ -3117,7 +3126,7 @@
<entry><structfield>starelid</structfield></entry>
<entry><type>oid</type></entry>
<entry><literal><link linkend="catalog-pg-class"><structname>pg_class</structname></link>.oid</literal></entry>
- <entry>The table that the described column belongs to</entry>
+ <entry>The table or index that the described column belongs to</entry>
</row>
<row>