PG_TEST_TIMING(1) PostgreSQL 18.6 Documentation PG_TEST_TIMING(1) (NAME) pg_test_timing - (SYNOPSIS) pg_test_timing [option...] (DESCRIPTION) pg_test_timing . EXPLAIN ANALYZE . (OPTIONS) pg_test_timing : -d duration --duration=duration . . . -V --version pg_test_timing . -? --help pg_test_timing . (USAGE) (>) . . Intel i7-860 TSC : Testing timing overhead for 3 seconds. Per loop time including overhead: 35.96 ns Histogram of timing durations: < us % of total count 1 96.40465 80435604 2 3.59518 2999652 4 0.00015 126 8 0.00002 13 16 0.00000 2 . (ns) (us) . EXPLAIN ANALYZE . psql : CREATE TABLE t AS SELECT * FROM generate_series(1,100000); \timing SELECT COUNT(*) FROM t; EXPLAIN ANALYZE SELECT COUNT(*) FROM t; i7-860 . EXPLAIN ANALYZE . , . . pg_test_timing . . . . acpi_pm : # cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc hpet acpi_pm # echo acpi_pm > /sys/devices/system/clocksource/clocksource0/current_clocksource # pg_test_timing Per loop time including overhead: 722.92 ns Histogram of timing durations: < us % of total count 1 27.84870 1155682 2 72.05956 2990371 4 0.07810 3241 8 0.01357 563 16 0.00007 3 EXPLAIN ANALYZE . . . . EXPLAIN ANALYZE . FreeBSD : # dmesg | grep "Timecounter" Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 Timecounter "i8254" frequency 1193182 Hz quality 0 Timecounters tick every 10.000 msec Timecounter "TSC" frequency 2531787134 Hz quality 800 # sysctl kern.timecounter.hardware=TSC kern.timecounter.hardware: ACPI-fast -> TSC . "clock" . "jiffies" . : $ cat /sys/devices/system/clocksource/clocksource0/available_clocksource jiffies $ dmesg | grep time.c time.c: Using 3.579545 MHz WALL PM GTOD PIT/TSC timer. time.c: Detected 2400.153 MHz processor. $ pg_test_timing Testing timing overhead for 3 seconds. Per timing duration including loop overhead: 97.75 ns Histogram of timing durations: < us % of total count 1 90.23734 27694571 2 9.75277 2993204 4 0.00981 3010 8 0.00007 22 16 0.00000 1 32 0.00000 1 . . ( ) . (clock source) . . . . . . . Time Stamp Counter (TSC) . TSC . TSC . TSC . TSC . . TSC . TSC . TSC . TSC . High Precision Event Timer (HPET) TSC . . (ACPI) (PM) acpi_pm . acpi_pm . (PC) : (PIT) (RTC) (APIC) Cyclone. . (SEE ALSO) EXPLAIN(7) PostgreSQL 18.6 2026 PG_TEST_TIMING(1)