Re: Adding getrusage profiling data to EXPLAIN output

From: Greg Stark <stark(at)mit(dot)edu>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Adding getrusage profiling data to EXPLAIN output
Date: 2010-10-04 16:20:06
Message-ID: AANLkTimxF64rwF7DW2no++yDd9hU_Zk4C3v93DhV65e6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 4, 2010 at 3:29 AM, Itagaki Takahiro
<itagaki(dot)takahiro(at)gmail(dot)com> wrote:
>  * There are some overlaps between the feature and DTrace hooks.
>   If we need such extension even though we have DTrace hooks,
>   it might mean DTrace hooks are hard to use for average users
>   and maybe also for postgres' hackers...

I've had it on my radar for a long time to make use of DTrace directly
in EXPLAIN output. The dtrace folk are really not interested in
programmatic access to the interfaces to the counters becasue they're
afraid it'll nail down internal interfaces too early. But I do think
there's lots of potential there.

>  * Some kinds of statistical sampling could solve too much overhead
>   in stop-watch based algorithm. Sampling is not always accurate,
>   but it might have better balance between overhead and resolution.
>

Tom experimented with doing statistical sampling and found the results
were even worse than the overhead from stopwatch profiling. I think we
should be able to subtract the overhead from the measurements if it's
a problem. But actually in the case of getrusage stats I don't think
it's an issue. The main interesting bits in getrusage are inblock and
oublock which don't have any profiling overhead -- getrusage doesn't
do any i/o. if you're only concerned with the cpu run-time of an
in-memory query you don't really need to look at getrusage at all.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-10-04 16:42:41 Re: ALTER DATABASE RENAME with HS/SR
Previous Message Greg Stark 2010-10-04 16:14:06 Re: wip: functions median and percentile