Re: Adding getrusage profiling data to EXPLAIN output

Itagaki Takahiro <itagaki.takahiro@gmail.com>

From: Itagaki Takahiro <itagaki.takahiro@gmail.com>
To: Greg Stark <stark@mit.edu>
Cc: pgsql-hackers@postgresql.org
Date: 2010-10-04T10:29:43Z
Lists: pgsql-hackers
On Sat, Oct 2, 2010 at 3:14 AM, Greg Stark <stark@mit.edu> wrote:

> The observed timings are
> query only                  100.5ms
> explain (analyze)          1234.9ms
> explain (analyze,resource) 2210.2ms

It's very large overheads, but I think it is still useful
if there are no overhead if we disable the resource option.

Some random ideas and comments:
 * Only top-level rusage might be useful as a replacement for
   ancient log_xxx_stats, and should have smaller overhead than
   full-spec counters.
 * 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...
 * 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.

-- 
Itagaki Takahiro