diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-29 20:11:45 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-12-29 20:11:45 +0000 |
commit | 649b5ec7c8a3050a30bd6d36003ba3a681c9a198 (patch) | |
tree | af041b646426d71d9ea1113837b5f7a9001082c9 /doc/src | |
parent | 84d723b6cefcf25b8c800f8aa6cf3c9538a546b4 (diff) |
Add the ability to store inheritance-tree statistics in pg_statistic,
and teach ANALYZE to compute such stats for tables that have subclasses.
Per my proposal of yesterday.
autovacuum still needs to be taught about running ANALYZE on parent tables
when their subclasses change, but the feature is useful even without that.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 82d3658a50b..0acd79361bd 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.214 2009/12/17 14:36:15 rhaas Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.215 2009/12/29 20:11:42 tgl Exp $ --> <!-- Documentation of the system catalogs, directed toward PostgreSQL developers --> @@ -4506,19 +4506,32 @@ The catalog <structname>pg_statistic</structname> stores statistical data about the contents of the database. Entries are created by <xref linkend="sql-analyze" endterm="sql-analyze-title"> - and subsequently used by the query planner. There is one entry for - each table column that has been analyzed. Note that all the + and subsequently used by the query planner. Note that all the statistical data is inherently approximate, even assuming that it is up-to-date. </para> <para> + Normally there is one entry, with <structfield>stainherit</> = + <literal>false</>, for each table column that has been analyzed. + If the table has inheritance children, a second entry with + <structfield>stainherit</> = <literal>true</> is also created. This row + represents the column's statistics over the inheritance tree, i.e., + statistics for the data you'd see with + <literal>SELECT <replaceable>column</> FROM <replaceable>table</>*</literal>, + whereas the <structfield>stainherit</> = <literal>false</> row represents + the results of + <literal>SELECT <replaceable>column</> FROM ONLY <replaceable>table</></literal>. + </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. + for the underlying table column. Currently, entries for index expressions + always have <structfield>stainherit</> = <literal>false</>. </para> <para> @@ -4573,6 +4586,14 @@ </row> <row> + <entry><structfield>stainherit</structfield></entry> + <entry><type>bool</type></entry> + <entry></entry> + <entry>If true, the stats include inheritance child columns, not just the + values in the specified relation</entry> + </row> + + <row> <entry><structfield>stanullfrac</structfield></entry> <entry><type>float4</type></entry> <entry></entry> @@ -7115,6 +7136,14 @@ </row> <row> + <entry><structfield>inherited</structfield></entry> + <entry><type>bool</type></entry> + <entry></entry> + <entry>If true, this row includes inheritance child columns, not just the + values in the specified table</entry> + </row> + + <row> <entry><structfield>null_frac</structfield></entry> <entry><type>real</type></entry> <entry></entry> |