Identifying Slow Queries and Fixing Them!
summary
PostgreSQL logging and stats expose concrete fixes: enable log_min_duration_statement (zero logs every statement, or use log_min_duration_sample with a sample rate), parse logs with pg_badger, and inspect active queries with pg_stat_statements. EXPLAIN/ANALYZE and auto_explain reveal plans — e.g. a PG_SLEEP shows ~1001 ms, a big external sort costs ~1.4 s, a seq scan reads ~30,000 rows to return 234. Raise work_mem, tune checkpoints/max_wal_size, VACUUM visibility map, use pg_bloat_check and review pg_stat_user_indexes.
AI-written summary · about
chapters (5)
- 0:00Start
- 6:22log checkpoints
- 20:01PostgreSQL Configuration
- 22:21Dead Tuples / Bloat
- 30:58Fixing Slow Queries
related talks
57mQuery Logging and Workload Analysis
23mBest Practices for Tuning Slow Postgres Queries
41mOptimizing your app by understanding your PostgreSQL database
24mTop 5 PostgreSQL Query Tuning Tips
49mHELP!!1! The database is slow!!
26mTroubleshooting High CPU Utilization in PostgreSQL Databases
49mLeveraging pgBadger for Effective PostgreSQL Troubleshooting
51mPostgreSQL Query Performance Insights
