Re: Patch: add timing of buffer I/O requests

Greg Smith <greg@2ndquadrant.com>

From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-hackers@postgresql.org
Date: 2012-01-17T18:08:48Z
Lists: pgsql-hackers

Attachments

Attached is the pg_test_timing utility portion of this submission, 
broken out into its own patch.  It's a contrib module modeled on 
pg_test_fsync.

The documentation is still a bit rough, I'm not done with that yet.  I 
have included an example of good timing results, switching to a bad 
clock source, and the resulting bad results.  Code review found some 
formatting things to nitpick I've already fixed:  non-standard brace 
locations and not including enough spaces in expressions were the main two.

This is now referenced by the existing cryptic documentation comment 
around EXPLAIN ANALYZE, which says that overhead can be high because 
gettimeofday is slow on some systems.  Since this utility measures that 
directly, I think it's a clear win to include it just for that purpose.  
The fact that there are more places coming where timing overhead matters 
is also true.  But this existing one is already bad enough to justify 
shipping something to help measure/manage it in my mind.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com