Re: pg_statistic doesnt contain details for specific table - Mailing list pgsql-performance

From Michael Fuhr
Subject Re: pg_statistic doesnt contain details for specific table
Date
Msg-id 20070611143423.GA33335@winnie.fuhr.org
Whole thread Raw
In response to Re: pg_statistic doesnt contain details for specific table  ("Nimesh Satam" <nimesh.zedo@gmail.com>)
List 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

pgsql-performance by date:

Previous
From: "Nimesh Satam"
Date:
Subject: Re: pg_statistic doesnt contain details for specific table
Next
From: Jim Nasby
Date:
Subject: Re: dbt2 NOTPM numbers