Closed soudai closed 10 months ago
俺は!!初手から!!!認証を外すぞ!!!(前回認証を外したら早くなったので
環境作った。 trustで認証している
CREATE EXTENSION pg_stat_statements;
ライブラリをpostgresql.confに書き込む
shared_preload_libraries = 'pg_stat_statements'
https://www.postgresql.jp/document/15/html/pgstatstatements.html
-- reset
SELECT pg_stat_statements_reset();
SELECT query, calls, total_time, rows, 100.0 * shared_blks_hit /
nullif(shared_blks_hit + shared_blks_read, 0) AS hit_percent
FROM pg_stat_statements ORDER BY total_time DESC LIMIT 100;