Explain analyze getrusage tracking

Greg Stark <stark@mit.edu>

From: Greg Stark <stark@mit.edu>
To: "<pgsql-hackers@postgresql.org>" <pgsql-hackers@postgresql.org>
Date: 2010-11-15T02:33:27Z
Lists: pgsql-hackers

Attachments

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