Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling - Mailing list pgsql-patches

From Martijn van Oosterhout
Subject Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Date
Msg-id 20060512102254.GB12955@svana.org
Whole thread Raw
In response to Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling  ("Jim C. Nasby" <jnasby@pervasive.com>)
Responses Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling  (Simon Riggs <simon@2ndquadrant.com>)
Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-patches
On Thu, May 11, 2006 at 06:37:03PM -0500, Jim C. Nasby wrote:
> On Tue, May 09, 2006 at 10:37:04PM +0200, Martijn van Oosterhout wrote:
> > Note that the resulting times still include the overhead actually
> > incurred, I didn't filter it out. I want the times to remain reflecting
> > reality as closely as possible.
>
> If we actually know the overhead I think it'd be very useful at times to
> be able to remove it, especially if you're actually trying to compare to
> the planner estimates. Maybe worth adding an option to the command?

It's not quite as easy as that unfortunatly. Each node can estimate how
much overhead was incurred on that node. However, each node also
includes as part of its timing the overhead of all its decendant nodes.
So to really remove the overhead, the top-level would have to recurse
through the whole tree to decide what to remove.

What I'm hoping is that this patch will make the overhead so low in
normal operation that we don't need to go to that kind of effort.

> > - I also didn't make it optional. I'm unsure about whether it should be
> > optional or not, given the number of cases where it will make a
> > difference to be very few.
>
> The real question is how important it is to have the real data in the
> cases where it would make a difference, and I suspect we can't answer
> that until this is out in the field. It *might* be worth a #define or
> some other way to disable it that doesn't require patching code, but
> probably not.

A #define is doable, though messy. The code isn't all that long anyway
so a few #ifdefs might make it confusing. But I'll see what I can do.

Have a ncie day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-patches by date:

Previous
From: "Qingqing Zhou"
Date:
Subject: Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Next
From: Simon Riggs
Date:
Subject: Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling