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

From Tom Lane
Subject Re: Thoughts on statistics for continuously advancing columns
Date
Msg-id 2505.1262197456@sss.pgh.pa.us
Whole thread Raw
In response to Re: Thoughts on statistics for continuously advancing columns  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane escribi�:
>> Normally, yeah.  I think Josh's problem is that he's got
>> performance-critical queries that are touching the "moving edge" of the
>> data set, and so the part of the stats that are relevant to them is
>> changing fast, even though in an overall sense the table contents might
>> not be changing much.

> Maybe only tangentially related: if this was a setup partitioned by a
> timestamp, it would be very useful to be able to analyze only the
> current partition and have updated stats for the parent relation as
> well.  However AFAICT with your proposed changes in this area this would
> not work, right?  You'd need an analyze on the parent relation, which is
> painful.

Yeah, I was just thinking about that myself.  The parent-level ANALYZE
would approximately double the work involved, assuming that your total
data set is large enough to max out the number of blocks sampled.
So it'd be painful but not catastrophic.  Maybe the way to think about
the "incremental update" problem is to find a way to let ANALYZE
calculate parent-relation stats from the stats of the individual
partitions.  Not that I know how to do that either, but at least it's
a clearly stated task.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: PATCH: Add hstore_to_json()
Next
From: Greg Stark
Date:
Subject: Re: Thoughts on statistics for continuously advancing columns