Re: Incorrect expected rows by ANALYZE

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: <pgsql(at)mohawksoft(dot)com>
Cc: <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <sugita(at)srapc1327(dot)sra(dot)co(dot)jp>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Incorrect expected rows by ANALYZE
Date: 2003-04-07 15:32:35
Message-ID: Pine.LNX.4.33.0304070930460.14934-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 7 Apr 2003 pgsql(at)mohawksoft(dot)com wrote:

> > 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.
>
> Couldn't there be an ANALYZE FULL option?

There's something close, that is, you can change the statistics target for
a column in a table like so:

ALTER TABLE [ ONLY ] table [ * ]
ALTER [ COLUMN ] column SET STATISTICS integer

which can make it so that more of the rows are analyzed.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message scott.marlowe 2003-04-07 15:35:07 Re: more contrib: log rotator
Previous Message pgsql 2003-04-07 15:21:27 Re: Incorrect expected rows by ANALYZE