Skip site navigation (1) Skip section navigation (2)

Re: Thoughts on statistics for continuously advancing columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Josh Berkus <josh(at)agliodbs(dot)com>, Nathan Boley <npboley(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thoughts on statistics for continuously advancing columns
Date: 2009-12-30 18:24:16
Message-ID: 2505.1262197456@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)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

In response to

pgsql-hackers by date

Next:From: Greg StarkDate: 2009-12-30 18:42:38
Subject: Re: Thoughts on statistics for continuously advancing columns
Previous:From: Andrew DunstanDate: 2009-12-30 18:23:55
Subject: Re: PATCH: Add hstore_to_json()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group