Re: Incorrect expected rows by ANALYZE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Incorrect expected rows by ANALYZE
Date
Msg-id 27762.1049725145@sss.pgh.pa.us
Whole thread Raw
In response to Incorrect expected rows by ANALYZE  (Kenji Sugita <sugita@srapc1327.sra.co.jp>)
Responses Re: Incorrect expected rows by ANALYZE  (pgsql@mohawksoft.com)
Re: Incorrect expected rows by ANALYZE  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
Kenji Sugita <sugita@srapc1327.sra.co.jp> writes:
> Why do dead tuples cause incorrect expected rows by ANALYZE?

Because it extrapolates the density of live rows in the whole table from
their density in the first few pages.

There has been some previous discussion of how to improve this, but no
really workable ideas AFAIR.  Ultimately, unless you want to abandon
the notion that ANALYZE only samples the table and doesn't read the
whole thing, there will be situations where it gets fooled.  But
possibly we can make those situations less likely to correspond to
common real-world cases.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Question abour PostgreSQL
Next
From: "Dave Page"
Date:
Subject: pg_clog woes with 7.3.2