Update postgresql configuration

# postgresql.conf
shared_preload_libraries = 'pg_stat_statements'

pg_stat_statements.track = all
pg_stat_statements.max = 10000
track_io_timing = on

Restart database

sudo systemctl restart postgresql

Membuat extensi dari postgres

CREATE EXTENSION IF NOT EXISTS pg_stat_statements;

Check pg_stat statement

SELECT count(*) FROM pg_stat_statements;

Leave a Reply

Your email address will not be published. Required fields are marked *