pg_stat_statements
The pg_stat_statements extension allows to trace the execution statistics of all queries. It is an essential extension in understanding the activity of a PostgreSQL cluster.
Installation
Modify postgresql.conf
postgresql.conf#
# Track all statements
pg_stat_statements.track = all
#
# Optional, not necessary for Datasentinel to save pg_stat_statements.
pg_stat_statements.save = false
#
# The extension's maximum number of tracked statements should be reduced from its default 5000 value
# (e.g. 2000) as Datasentinel collects metrics at regular intervals.
pg_stat_statements.max = 2000
#
# Since postgresql 14
compute_query_id = on
#
# log IO timing
track_io_timing=onReload Conf
Create Extension
Check Extension
Last updated