From: | Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | pg_statistic, lack of documentation |
Date: | 2012-01-14 12:34:58 |
Message-ID: | CAL_0b1sm1eXnhN=GgXLdswnBN3rbt-8=LA6GBQPCaFoDURMzrQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)[local]:5432 test=#create table t1 (i integer);CREATE
TABLEgrayhemp(at)[local]:5432 test=#select stanullfrac, stawidth from
pg_statistic where starelid = 't1'::regclass; stanullfrac | stawidth
-------------+----------(0 rows)
grayhemp(at)[local]:5432 test=#analyze t1;ANALYZEgrayhemp(at)[local]:5432
test=#select stanullfrac, stawidth from pg_statistic where starelid =
't1'::regclass; stanullfrac | stawidth -------------+----------(0
rows)
grayhemp(at)[local]:5432 test=#insert into t1 values (1);INSERT 0
1grayhemp(at)[local]:5432 test=#select stanullfrac, stawidth from
pg_statistic where starelid = 't1'::regclass; stanullfrac | stawidth
-------------+----------(0 rows)
grayhemp(at)[local]:5432 test=#analyze t1;ANALYZEgrayhemp(at)[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(dot)ru(at)gmail(dot)com Skype: gray-hemp
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2012-01-14 13:40:08 | Re: controlling the location of server-side SSL files |
Previous Message | Peter Eisentraut | 2012-01-14 12:23:49 | psql NUL record and field separator |