pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rural Hunter <ruralhunter@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: wrong count estimation in query plan
Date: Fri, 31 Oct 2014 21:33:08 +0800
Message-ID: <54538F94.3010507@gmail.com> (raw)
In-Reply-To: <19884.1414679157@sss.pgh.pa.us>
References: <5451E60A.60009@gmail.com>
	<19884.1414679157@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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.


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (3+ messages)

Message-ID: <54538F94.3010507@gmail.com>
Permalink:  ../54538F94.3010507@gmail.com/
Also on:    postgresql.org/message-id/54538F94.3010507@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ruralhunter@gmail.com, tgl@sss.pgh.pa.us
  Subject: Re: wrong count estimation in query plan
  In-Reply-To: <54538F94.3010507@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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