Re: Thoughts on statistics for continuously advancing columns - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Thoughts on statistics for continuously advancing columns
Date
Msg-id 1262200897.15659.4.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: Thoughts on statistics for continuously advancing columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Thoughts on statistics for continuously advancing columns  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On tis, 2009-12-29 at 22:08 -0500, Tom Lane wrote:
> This seems like a fundamentally broken approach, first because "time
> between analyzes" is not even approximately a constant, and second
> because it assumes that we have a distance metric for all datatypes.

Maybe you could compute a correlation between the column values and the
transaction numbers to recognize a continuously advancing column.  It
wouldn't tell you much about how fast they are advancing, but at least
the typical use cases of serial and current timestamp columns should
clearly stick out.  And then instead of assuming that a value beyond the
histogram bound doesn't exist, you assume for example the average
frequency, which should be pretty good for the serial and timestamp
cases.  (Next step: Fourier analysis ;-) )



pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Thoughts on statistics for continuously advancing columns
Next
From: Robert Haas
Date:
Subject: Re: PATCH: Add hstore_to_json()