Re: pg_statistic doesnt contain details for specific table

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Nimesh Satam <nimesh(dot)zedo(at)gmail(dot)com>
Cc: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>, pgsql-performance(at)postgresql(dot)org, database(at)zedo(dot)com
Subject: Re: pg_statistic doesnt contain details for specific table
Date: 2007-06-11 14:34:23
Message-ID: 20070611143423.GA33335@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Jun 11, 2007 at 07:22:24PM +0530, Nimesh Satam wrote:
> INFO: analyzing "public.cam_attr"
> INFO: "cam_attr": scanned 103 of 103 pages, containing 11829 live rows and
> 0 dead rows; 6000 rows in sample, 11829 estimated total rows

Looks reasonable.

> Also how do we check if the statistics are set to Zero for the table?

SELECT attname, attstattarget
FROM pg_attribute
WHERE attrelid = 'public.cam_attr'::regclass
AND attnum > 0
AND NOT attisdropped;

If nobody has changed the statistics targets then they're all
probably -1. Negative attstattarget values mean to use the system
default, which you can see with:

SHOW default_statistics_target;

How exactly are you determining that no statistics are showing up
for this table? Are you running a query like the following?

SELECT *
FROM pg_stats
WHERE schemaname = 'public' AND tablename = 'cam_attr';

--
Michael Fuhr

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dave Cramer 2007-06-11 15:09:42 Re: How much ram is too much
Previous Message Nimesh Satam 2007-06-11 13:52:24 Re: pg_statistic doesnt contain details for specific table