Skip site navigation (1) Skip section navigation (2)

pg_statistic, lack of documentation

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 (view raw or flat)
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

Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2012-01-14 13:40:08
Subject: Re: controlling the location of server-side SSL files
Previous:From: Peter EisentrautDate: 2012-01-14 12:23:49
Subject: psql NUL record and field separator

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group