Lists: | pgsql-hackers |
---|
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 |
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: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_statistic, lack of documentation |
Date: | 2012-01-27 17:14:38 |
Message-ID: | CA+TgmoYGvM1sTDx1+MYuwZEeG4J969OeMg-V=i9uXehVvUUrRQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sat, Jan 14, 2012 at 7:34 AM, Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> wrote:
> 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.
The actual behavior, in somewhat more detail, is that the existing
statistics entries, if any, are retained.
I've added a note to that effect to the documentation for ANALYZE,
which seems like a more appropriate place than the pg_statistic
documentation.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From: | Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_statistic, lack of documentation |
Date: | 2012-01-27 19:42:46 |
Message-ID: | CAL_0b1tZuk88GHnKE5Z5SQQFb8zfmdA4cC=C+6hLbMEu1qZm=A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Fri, Jan 27, 2012 at 9:14 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Sat, Jan 14, 2012 at 7:34 AM, Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> wrote:
> I've added a note to that effect to the documentation for ANALYZE,
> which seems like a more appropriate place than the pg_statistic
> documentation.
Thank you.
>
> --
> Robert Haas
> EnterpriseDB: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
--
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