Re: ANALYZE to be ignored by VACUUM - Mailing list pgsql-hackers

From ITAGAKI Takahiro
Subject Re: ANALYZE to be ignored by VACUUM
Date
Msg-id 20080220130529.6387.52131E4D@oss.ntt.co.jp
Whole thread Raw
In response to Re: ANALYZE to be ignored by VACUUM  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Gregory Stark <stark@enterprisedb.com> wrote:

> > 4. ANALYZE finishes in a short time.
> There was a paper with a nice algorithm posted a while back which required
> only constant memory but it depended on scanning the entire table. I think to
> do n_distinct estimates we'll need some statistics which are either gathered
> opportunistically whenever a seqscan happens or maintained by an index.

VACUUM would be another good timing for the alogrithm, because it does
a seqscan. If we do so, we need to separate an analyzing transaction
into sampling and updating-stats transactions to keep vacuums as
ignorable transactions.

However, VACUUM will not do a seqscan when we have Dead Space Map or
Segment Visibility Map. We will need incremental statistics updating
if reliable n_distinct estimation requires many samples.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center




pgsql-hackers by date:

Previous
From: Luke Lonergan
Date:
Subject: Re: 8.3 / 8.2.6 restore comparison
Next
From: Robert Treat
Date:
Subject: Re: Permanent settings