Explain analyze getrusage tracking

From: Greg Stark <stark(at)mit(dot)edu>
To: "<pgsql-hackers(at)postgresql(dot)org>" <pgsql-hackers(at)postgresql(dot)org>
Subject: Explain analyze getrusage tracking
Date: 2010-11-15 02:33:27
Message-ID: AANLkTikdqGshABDgkALheNZna7HBSQwzy39hDe1cn_nf@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This is an update to my earlier patch to add getrusage resource
tracking to EXPLAIN ANALYZE.

With this patch you get something like:

QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Seq Scan on i (cost=0.00..6919.44 rows=262144 width=101) (actual
time=17.240..1123.751 rows=262144 loops=1)
Resources: sys=210.000ms user=430.000ms read=33.6MB
Buffers: shared read=4298
Total runtime: 1548.651 ms
(4 rows)

The main change is to make it work under Windows. At least I think the
changes should make it work under Windows, I haven't been able to test
it. Actually I'm not to happy with the way I did it, I would be more
inclined to hack the getrusagestub,h definition of struct rusage to
have an instr_time in it so that we can use the same macros directly.
But that's more changes than I would be happy making without being
able to compile them to test them.

--
greg

Attachment Content-Type Size
explain-getrusage-v3.diff text/x-patch 16.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-11-15 02:34:23 Re: Fix for cube picksplit function
Previous Message Itagaki Takahiro 2010-11-15 02:21:30 Re: Comparison with "true" in source code