Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Date: 2006-05-12 10:22:54
Message-ID: 20060512102254.GB12955@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2006-05-12 10:46:38 Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Previous Message Qingqing Zhou 2006-05-12 09:57:58 Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2006-05-12 10:46:38 Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling
Previous Message Qingqing Zhou 2006-05-12 09:57:58 Re: [PATCH] Improve EXPLAIN ANALYZE overhead by sampling