Re: wrong count estimation in query plan

From: Rural Hunter <ruralhunter(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: wrong count estimation in query plan
Date: 2014-10-31 13:33:08
Message-ID: 54538F94.3010507@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

在 2014/10/30 22:25, Tom Lane 写道:
> If ANALYZE doesn't scan the entire table then it updates the rowcount
> estimate using a moving-average approach, rather than assuming that
> the blocks it did look at are necessarily completely representative.
> That causes the estimate to converge over multiple passes. Since it
> took so many cycles to get close to reality, we can conclude that the
> table is several times larger than the number of blocks ANALYZE is
> willing to sample ... which, for a table with only 1000 rows in it,
> says you've got a bad table-bloat problem. VACUUM FULL or CLUSTER
> might be indicated. regards, tom lane
Got it. A vacuum solved the problem. Thanks.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Guillaume Lelarge 2014-11-02 21:41:17 Re: potential invalid input field of New Column GUI
Previous Message Tom Lane 2014-10-30 14:25:57 Re: wrong count estimation in query plan