pg_test_timing — measure timing overhead
pg_test_timing [option...]
pg_test_timing is a tool to measure the timing overhead
on your system and confirm that the system time never moves backwards.
Systems that are slow to collect timing data can give less accurate
EXPLAIN ANALYZE results.
pg_test_timing accepts the following command-line options:
-d duration--duration=durationSpecifies the test duration, in seconds. Longer durations give slightly better accuracy, and are more likely to discover problems with the system clock moving backwards. The default test duration is 3 seconds.
-V--versionPrint the pg_test_timing version and exit.
-?--helpShow help about pg_test_timing command line arguments, and exit.
Good results will show most (>90%) individual timing calls take less than one microsecond. Average per loop overhead will be even lower, below 100 nanoseconds. This example from an Intel i7-860 system using a TSC clock source shows excellent performance:
Testing timing overhead for 3 seconds. Per loop time including overhead: 35.96 ns Histogram of timing durations: < us % of total c