Skip to main content

PostgreSQL SQL Statistics

SQL statistic nameDescriptionDBmarlin collects?Doc Link
durationDerived field = total_time / total_exec_time Yes - derivedN/A
executionsDerived field=calls Yes - derivedN/A
logical_readsDerived field = shared_blks_hit + shared_blks_read Yes - derivedN/A
logical_writesDerived filed = shared_blks_dirtied + shared_blks_written Yes - derivedN/A
physical_readsDerived field = shared_blks_read Yes - derivedN/A
total_timePostgreSQL 12 or earlier Yes https://www.postgresql.org/docs/12/pgstatstatements.html
callsNumber of times the statement was executed Yes https://www.postgresql.org/docs/current/pgstatstatements.html
shared_blks_hitTotal number of shared block cache hits by the statement Yes https://www.postgresql.org/docs/current/pgstatstatements.html
shared_blks_readTotal number of shared blocks read by the statement Yes https://www.postgresql.org/docs/current/pgstatstatements.html
shared_blks_dirtiedTotal number of shared blocks dirtied by the statement Yes https://www.postgresql.org/docs/current/pgstatstatements.html
shared_blks_writtenTotal number of shared blocks written by the statement Yes https://www.postgresql.org/docs/current/pgstatstatements.html
total_exec_timeTotal time spent executing the statement, in milliseconds Yes https://www.postgresql.org/docs/current/pgstatstatements.html
useridOID of user who executed the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
dbidOID of database in which the statement was executed No https://www.postgresql.org/docs/current/pgstatstatements.html
toplevelTrue if the query was executed as a top-level statement No https://www.postgresql.org/docs/current/pgstatstatements.html
queryidHash code to identify identical normalized queries No https://www.postgresql.org/docs/current/pgstatstatements.html
queryText of a representative statement No https://www.postgresql.org/docs/current/pgstatstatements.html
plansNumber of times the statement was planned No https://www.postgresql.org/docs/current/pgstatstatements.html
total_plan_timeTotal time spent planning the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
min_plan_timeMinimum time spent planning the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
max_plan_timeMaximum time spent planning the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
mean_plan_timeMean time spent planning the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
stddev_plan_timePopulation standard deviation of time spent planning the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
min_exec_timeMinimum time spent executing the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
max_exec_timeMaximum time spent executing the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
mean_exec_timeMean time spent executing the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
stddev_exec_timePopulation standard deviation of time spent executing the statement, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
rowsTotal number of rows retrieved or affected by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
local_blks_hitTotal number of local block cache hits by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
local_blks_readTotal number of local blocks read by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
local_blks_dirtiedTotal number of local blocks dirtied by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
local_blks_writtenTotal number of local blocks written by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
temp_blks_readTotal number of temp blocks read by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
temp_blks_writtenTotal number of temp blocks written by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
blk_read_timeTotal time the statement spent reading data file blocks, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
blk_write_timeTotal time the statement spent writing data file blocks, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
temp_blk_read_timeTotal time the statement spent reading temporary file blocks, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
temp_blk_write_timeTotal time the statement spent writing temporary file blocks, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
wal_recordsTotal number of WAL records generated by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
wal_fpiTotal number of WAL full page images generated by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
wal_bytesTotal amount of WAL generated by the statement in bytes No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_functionsTotal number of functions JIT-compiled by the statement No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_generation_timeTotal time spent by the statement on generating JIT code, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_inlining_countNumber of times functions have been inlined No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_inlining_timeTotal time spent by the statement on inlining functions, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_optimization_countNumber of times the statement has been optimized No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_optimization_timeTotal time spent by the statement on optimizing, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_emission_countNumber of times code has been emitted No https://www.postgresql.org/docs/current/pgstatstatements.html
jit_emission_timeTotal time spent by the statement on emitting code, in milliseconds No https://www.postgresql.org/docs/current/pgstatstatements.html

Search online​

If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.