Re: Buffer pool statistics in Explain Analyze

From: "Vladimir Sitnikov" <sitnikov(dot)vladimir(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Buffer pool statistics in Explain Analyze
Date: 2008-10-12 01:01:20
Message-ID: 1d709ecc0810111801o4a3929e4n67c2500b80cb48a4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The main problem I ran into was that the instrumentation nodes currently are

> nested. That is, all the time for your children counts against you as well.
> Is
> that what we want for I/O costs?

As for me, I see nothing wrong with such costs model. I think it is good to
know stuff like "the whole query took 3244 I/O" and "this join takes 34
I/O". So, every instrumentation node should not try to figure out its
intrinsic I/O counters.

Another point is both "time" and "I/O" metrics should match. I do not see a
reason to change current "actual time" behaviour.

> If it is then I think it's fairly simple, have a global set of counters for
> various I/O events which are zeroed when the executor starts. Every time an
> instrumentation node starts it notes the starting point for all those
> counters, whenever it ends take the difference and add that to its personal
> counts.
>
I've tried to use "ReadBufferCount and friends" from
storage\buffer\buf_init.c, however it is showing zeroes for some unknown yet
reason. Hope, there is no fundamental problem behind.

One more problem with current counters in buf_init.c is ResetBufferUsage
that zeroes those counters at random (e.g. if log_executor_stats or
log_statement_stats is enabled). I am not sure if it could interfere with
instrumentation.

Regards,
Vladimir Sitnikov

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-12 02:21:44 Re: recursive query crash
Previous Message Gregory Stark 2008-10-12 00:43:40 Re: recursive query crash