1. 查看占io的sql: postgres=# select userid::regrole, dbid, query from pg_stat_statements order by total_time desc limit 5;
ERROR: pg_stat_statements must be loaded via shared_preload_libraries
2. 添加配置
#postgresql.conf #------------------------------------------------------------------------------ # PG_STAT_STATEMENTS OPTIONS #------------------------------------------------------------------------------ shared_preload_libraries = ‘pg_stat_statements‘ custom_variable_classes = ‘pg_stat_statements‘ pg_stat_statements.max = 1000 pg_stat_statements.track = all ———————————————— 原文链接:https://blog.csdn.net/lengzijian/article/details/8133471
ERROR: pg_stat_statements must be loaded via shared_preload_libraries