Wrong Stats and Poor Performance - Mailing list pgsql-performance

From Pallav Kalva
Subject Wrong Stats and Poor Performance
Date
Msg-id 41D059EB.9090201@deg.cc
Whole thread Raw
Responses Re: Wrong Stats and Poor Performance
List pgsql-performance
Hi Everybody.

      I have a table in my production database which gets updated
regularly and the stats on this table in pg_class  are totally wrong.  I
used to run vacuumdb on the whole database daily once and when i posted
the same problem of wrong stats in the pg_class most of them from this
list and also from postgres docs suggested me to run the "vacuum
analyze" more frequently on this table.

I had a setup a cronjob couple of weeks ago to run vacuum analyze every
3 hours on this table and still my stats are totally wrong. This is
affecting the performance of the queries running on this table very badly.

How can i fix this problem ?  or is this the standard postgres behaviour ?

Here are the stats from the problem table on my production database

 relpages |  reltuples
----------+-------------
   168730 | 2.19598e+06

If i rebuild the same table on dev db and check the stats they are
totally different, I was hoping that there would be some difference in
the stats from the production db stats but not at this extent, as you
can see below there is a huge difference in the stats.

 relpages | reltuples
----------+-----------
    25230 |    341155


Thanks!
Pallav



pgsql-performance by date:

Previous
From: Ragnar Hafstað
Date:
Subject: Re: Howto Increased performace ?
Next
From: John A Meinel
Date:
Subject: Re: Wrong Stats and Poor Performance