Unix Technical Forum

pg_statistic doesnt contain details for specific table

This is a discussion on pg_statistic doesnt contain details for specific table within the Pgsql Performance forums, part of the PostgreSQL category; --> Hi, While monitioring we noticed that there are no details in the pg_statistics for a particular table. Can you ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 09:58 AM
Nimesh Satam
 
Posts: n/a
Default pg_statistic doesnt contain details for specific table

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 09:58 AM
Heikki Linnakangas
 
Posts: n/a
Default Re: pg_statistic doesnt contain details for specific table

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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-19-2008, 09:58 AM
Nimesh Satam
 
Posts: n/a
Default Re: pg_statistic doesnt contain details for specific table

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
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-19-2008, 09:58 AM
Michael Fuhr
 
Posts: n/a
Default Re: pg_statistic doesnt contain details for specific table

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

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-19-2008, 09:58 AM
Nimesh Satam
 
Posts: n/a
Default Re: pg_statistic doesnt contain details for specific table

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
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-19-2008, 09:58 AM
Michael Fuhr
 
Posts: n/a
Default Re: pg_statistic doesnt contain details for specific table

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

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:15 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com