Re: estimating # of distinct values - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: estimating # of distinct values
Date
Msg-id 1294234986.3889.22.camel@clnt-sysecm-cnagy
Whole thread Raw
In response to Re: estimating # of distinct values  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: estimating # of distinct values
List pgsql-hackers
On Thu, 2010-12-30 at 21:02 -0500, Tom Lane wrote:
> How is an incremental ANALYZE going to work at all?

How about a kind of continuous analyze ?

Instead of analyzing just once and then drop the intermediate results,
keep them on disk for all tables and then piggyback the background
writer (or have a dedicated process if that's not algorithmically
feasible) and before writing out stuff update the statistics based on
the values found in modified buffers. Probably it could take a random
sample of buffers to minimize overhead, but if it is done by a
background thread the overhead could be minimal anyway on multi-core
systems.

Not sure this makes sense at all, but if yes it would deliver the most
up to date statistics you can think of.

Cheers,
Csaba.




pgsql-hackers by date:

Previous
From: Zotov
Date:
Subject: join functions
Next
From: "Mehdi MAACHE (Pyrenet)"
Date:
Subject: Re: Intermittent buildfarm failures in sequence test