PostgreSQL Slow Query Fix: 47s to 3.6ms (DBA Cheat Sheet #5 )

Опубликовано: 06 Июнь 2026
на канале: PostgreSQL with Dr. Ibrar Ahmed
390
3

Last week it worked fine. The query did not change. The application did not change.

The data changed.

In PostgreSQL DBA Cheat Sheet #5, I walk through a practical workflow for finding, understanding, and fixing slow PostgreSQL queries in production.

You will learn how to use EXPLAIN ANALYZE, pg_stat_statements, pg_stat_activity, auto_explain, and real tuning techniques to diagnose performance issues before users complain.

This video covers:

EXPLAIN vs EXPLAIN ANALYZE
Reading execution plans
Row estimates
Sequential scans
Join analysis
Buffer reads and I/O
pg_stat_statements
pg_stat_activity
auto_explain
Slow query fix patterns
Live diagnostics demo
Common DBA mistakes

Chapters:

0:00 This query takes 47 seconds
0:30 EXPLAIN vs EXPLAIN ANALYZE
1:30 Reading execution plans
3:00 pg_stat_statements
4:30 Live monitoring with pg_stat_activity
5:30 Common fix patterns
6:30 Demo part 1: Find the slow query
7:15 Demo part 2: 847ms to 3.6ms
8:00 Five slow query mistakes
9:00 Slow query cheat sheet and summary

Part of the PostgreSQL DBA Cheat Sheet library.