pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_statistic doesnt contain details for specific table
6+ messages / 3 participants
[nested] [flat]

* pg_statistic doesnt contain details for specific table
@ 2007-06-11 08:50  Nimesh Satam <nimesh.zedo@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Nimesh Satam @ 2007-06-11 08:50 UTC (permalink / raw)
  To: pgsql-performance; database@zedo.com

Hi,


While monitioring we noticed that there are no details in the pg_statistics
for a particular table. Can you let us know what might be the reason? Also
what steps can be taken care for adding the statistics?

Note: The queries which are running on this table are taken longer time then
al the other queries.


Thanks,
Nimesh.

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_statistic doesnt contain details for specific table
@ 2007-06-11 08:54  Heikki Linnakangas <heikki@enterprisedb.com>
  parent: Nimesh Satam <nimesh.zedo@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Heikki Linnakangas @ 2007-06-11 08:54 UTC (permalink / raw)
  To: Nimesh Satam <nimesh.zedo@gmail.com>; +Cc: pgsql-performance; database@zedo.com

Nimesh Satam wrote:
> While monitioring we noticed that there are no details in the pg_statistics
> for a particular table. Can you let us know what might be the reason? Also
> what steps can be taken care for adding the statistics?

Have you ANALYZEd the table?

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_statistic doesnt contain details for specific table
@ 2007-06-11 08:58  Nimesh Satam <nimesh.zedo@gmail.com>
  parent: Heikki Linnakangas <heikki@enterprisedb.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Nimesh Satam @ 2007-06-11 08:58 UTC (permalink / raw)
  To: Heikki Linnakangas <heikki@enterprisedb.com>; +Cc: pgsql-performance; database@zedo.com

Heikki,


Thank you for replying.

We have already used analyze command on the table.
We have also ran the vacuum analyze command.


But they are not helping.

Thanks,
Nimesh.


On 6/11/07, Heikki Linnakangas <heikki@enterprisedb.com> wrote:
>
> Nimesh Satam wrote:
> > While monitioring we noticed that there are no details in the
> pg_statistics
> > for a particular table. Can you let us know what might be the reason?
> Also
> > what steps can be taken care for adding the statistics?
>
> Have you ANALYZEd the table?
>
> --
>   Heikki Linnakangas
>   EnterpriseDB   http://www.enterprisedb.com
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_statistic doesnt contain details for specific table
@ 2007-06-11 13:29  Michael Fuhr <mike@fuhr.org>
  parent: Nimesh Satam <nimesh.zedo@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Michael Fuhr @ 2007-06-11 13:29 UTC (permalink / raw)
  To: Nimesh Satam <nimesh.zedo@gmail.com>; +Cc: Heikki Linnakangas <heikki@enterprisedb.com>; pgsql-performance; database@zedo.com

On Mon, Jun 11, 2007 at 02:28:32PM +0530, Nimesh Satam wrote:
> We have already used analyze command on the table.
> We have also ran the vacuum analyze command.
> 
> But they are not helping.

Is there any data in the table?  What does ANALYZE VERBOSE or VACUUM
ANALYZE VERBOSE show for this table?  Is there any chance that
somebody set all of the columns' statistics targets to zero?

-- 
Michael Fuhr



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_statistic doesnt contain details for specific table
@ 2007-06-11 13:52  Nimesh Satam <nimesh.zedo@gmail.com>
  parent: Michael Fuhr <mike@fuhr.org>
  0 siblings, 1 reply; 6+ messages in thread

From: Nimesh Satam @ 2007-06-11 13:52 UTC (permalink / raw)
  To: Michael Fuhr <mike@fuhr.org>; +Cc: Heikki Linnakangas <heikki@enterprisedb.com>; pgsql-performance; database@zedo.com

Michael,


Following is the output of Vacuum analze on the same table:


*psql =# VACUUM ANALYZE verbose cam_attr;
INFO:  vacuuming "public.cam_attr"
INFO:  index "cam_attr_pk" now contains 11829 row versions in 63 pages
DETAIL:  0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  "cam_attr": found 0 removable, 11829 nonremovable row versions in 103
pages
DETAIL:  0 dead row versions cannot be removed yet.
There were 236 unused item pointers.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
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
VACUUM
*

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

Regards,
Nimesh.


On 6/11/07, Michael Fuhr <mike@fuhr.org> wrote:
>
> On Mon, Jun 11, 2007 at 02:28:32PM +0530, Nimesh Satam wrote:
> > We have already used analyze command on the table.
> > We have also ran the vacuum analyze command.
> >
> > But they are not helping.
>
> Is there any data in the table?  What does ANALYZE VERBOSE or VACUUM
> ANALYZE VERBOSE show for this table?  Is there any chance that
> somebody set all of the columns' statistics targets to zero?
>
> --
> Michael Fuhr
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_statistic doesnt contain details for specific table
@ 2007-06-11 14:34  Michael Fuhr <mike@fuhr.org>
  parent: Nimesh Satam <nimesh.zedo@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Fuhr @ 2007-06-11 14:34 UTC (permalink / raw)
  To: Nimesh Satam <nimesh.zedo@gmail.com>; +Cc: Heikki Linnakangas <heikki@enterprisedb.com>; pgsql-performance; database@zedo.com

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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2007-06-11 14:34 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-06-11 08:50 pg_statistic doesnt contain details for specific table Nimesh Satam <nimesh.zedo@gmail.com>
2007-06-11 08:54 ` Heikki Linnakangas <heikki@enterprisedb.com>
2007-06-11 08:58   ` Nimesh Satam <nimesh.zedo@gmail.com>
2007-06-11 13:29     ` Michael Fuhr <mike@fuhr.org>
2007-06-11 13:52       ` Nimesh Satam <nimesh.zedo@gmail.com>
2007-06-11 14:34         ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox