pg_statistic, lack of documentation - Mailing list pgsql-hackers

From Sergey Konoplev
Subject pg_statistic, lack of documentation
Date
Msg-id CAL_0b1sm1eXnhN=GgXLdswnBN3rbt-8=LA6GBQPCaFoDURMzrQ@mail.gmail.com
Whole thread Raw
Responses Re: pg_statistic, lack of documentation  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

http://www.postgresql.org/docs/9.1/interactive/catalog-pg-statistic.html

It specifies that entries are created by ANALYZE, but does not mention
that if a table is empty the entry for it is not created. Probably it
is worth to add to the docs. The test case is below.

grayhemp@[local]:5432 test=#create table t1 (i integer);CREATE
TABLEgrayhemp@[local]:5432 test=#select stanullfrac, stawidth from
pg_statistic where starelid = 't1'::regclass; stanullfrac | stawidth
-------------+----------(0 rows)
grayhemp@[local]:5432 test=#analyze t1;ANALYZEgrayhemp@[local]:5432
test=#select stanullfrac, stawidth from pg_statistic where starelid =
't1'::regclass; stanullfrac | stawidth -------------+----------(0
rows)
grayhemp@[local]:5432 test=#insert into t1 values (1);INSERT 0
1grayhemp@[local]:5432 test=#select stanullfrac, stawidth from
pg_statistic where starelid = 't1'::regclass; stanullfrac | stawidth
-------------+----------(0 rows)
grayhemp@[local]:5432 test=#analyze t1;ANALYZEgrayhemp@[local]:5432
test=#select stanullfrac, stawidth from pg_statistic where starelid =
't1'::regclass; stanullfrac | stawidth -------------+----------
   0 |        4(1 row)

--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com
LinkedIn: http://ru.linkedin.com/in/grayhemp
JID/GTalk: gray.ru@gmail.com Skype: gray-hemp


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: psql NUL record and field separator
Next
From: Peter Eisentraut
Date:
Subject: Re: controlling the location of server-side SSL files