What is the performance impact of pg_stat_statements?
9
votes
1
answer
6140
views
I am using
-- add the plugin create extension pg_stat_statements; select pg_stat_reset(); select pg_stat_statements_reset(); and then: -- find slow queries using the extension: select * from pg_stat_statements order by total_exec_time desc limit 50;
pg_stat_statements
to find the slow queries in my production PostgreSQL 13. Two things:
- I am unsure of the performance impact of this extension.
- Is there anything I can do to improve its performance? The query below takes > 1s - any suggestions?
-- add the plugin create extension pg_stat_statements; select pg_stat_reset(); select pg_stat_statements_reset(); and then: -- find slow queries using the extension: select * from pg_stat_statements order by total_exec_time desc limit 50;
Asked by Dolphin
(939 rep)
Dec 4, 2021, 06:39 AM
Last activity: Dec 7, 2021, 12:13 PM
Last activity: Dec 7, 2021, 12:13 PM