Re: Incorrect expected rows by ANALYZE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kenji Sugita <sugita(at)srapc1327(dot)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incorrect expected rows by ANALYZE
Date: 2003-04-07 14:19:05
Message-ID: 27762.1049725145@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kenji Sugita <sugita(at)srapc1327(dot)sra(dot)co(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2003-04-07 15:08:38 pg_clog woes with 7.3.2
Previous Message Michael Meskes 2003-04-07 13:48:16 Question abour PostgreSQL