PostgreSQL SQL Statistics
SQL statistic name | Description | DBmarlin collects? | Doc Link |
---|---|---|---|
duration | Derived field = total_time / total_exec_time | Yes - derived | N/A |
executions | Derived field=calls | Yes - derived | N/A |
logical_reads | Derived field = shared_blks_hit + shared_blks_read | Yes - derived | N/A |
logical_writes | Derived filed = shared_blks_dirtied + shared_blks_written | Yes - derived | N/A |
physical_reads | Derived field = shared_blks_read | Yes - derived | N/A |
total_time | PostgreSQL 12 or earlier | Yes | https://www.postgresql.org/docs/12/pgstatstatements.html |
calls | Number of times the statement was executed | Yes | https://www.postgresql.org/docs/current/pgstatstatements.html |
shared_blks_hit | Total number of shared block cache hits by the statement | Yes | https://www.postgresql.org/docs/current/pgstatstatements.html |
shared_blks_read | Total number of shared blocks read by the statement | Yes | https://www.postgresql.org/docs/current/pgstatstatements.html |
shared_blks_dirtied | Total number of shared blocks dirtied by the statement | Yes | https://www.postgresql.org/docs/current/pgstatstatements.html |
shared_blks_written | Total number of shared blocks written by the statement | Yes | https://www.postgresql.org/docs/current/pgstatstatements.html |
total_exec_time | Total time spent executing the statement, in milliseconds | Yes | https://www.postgresql.org/docs/current/pgstatstatements.html |
userid | OID of user who executed the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
dbid | OID of database in which the statement was executed | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
toplevel | True if the query was executed as a top-level statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
queryid | Hash code to identify identical normalized queries | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
query | Text of a representative statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
plans | Number of times the statement was planned | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
total_plan_time | Total time spent planning the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
min_plan_time | Minimum time spent planning the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
max_plan_time | Maximum time spent planning the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
mean_plan_time | Mean time spent planning the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
stddev_plan_time | Population standard deviation of time spent planning the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
min_exec_time | Minimum time spent executing the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
max_exec_time | Maximum time spent executing the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
mean_exec_time | Mean time spent executing the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
stddev_exec_time | Population standard deviation of time spent executing the statement, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
rows | Total number of rows retrieved or affected by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
local_blks_hit | Total number of local block cache hits by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
local_blks_read | Total number of local blocks read by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
local_blks_dirtied | Total number of local blocks dirtied by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
local_blks_written | Total number of local blocks written by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
temp_blks_read | Total number of temp blocks read by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
temp_blks_written | Total number of temp blocks written by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
blk_read_time | Total time the statement spent reading data file blocks, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
blk_write_time | Total time the statement spent writing data file blocks, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
temp_blk_read_time | Total time the statement spent reading temporary file blocks, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
temp_blk_write_time | Total time the statement spent writing temporary file blocks, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
wal_records | Total number of WAL records generated by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
wal_fpi | Total number of WAL full page images generated by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
wal_bytes | Total amount of WAL generated by the statement in bytes | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_functions | Total number of functions JIT-compiled by the statement | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_generation_time | Total time spent by the statement on generating JIT code, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_inlining_count | Number of times functions have been inlined | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_inlining_time | Total time spent by the statement on inlining functions, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_optimization_count | Number of times the statement has been optimized | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_optimization_time | Total time spent by the statement on optimizing, in milliseconds | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_emission_count | Number of times code has been emitted | No | https://www.postgresql.org/docs/current/pgstatstatements.html |
jit_emission_time | Total 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.