~/talk

Seamless SQL optimization

Talkat PGCon 2020 · 2020-05-26..05-29· [databases]
links:none on file
slides:none on file

Two complementary workflows: macro analysis with pg_stat_statements and log tools (pgBadger, sampled logging in PostgreSQL 12) finds high-impact groups — the demo query hits ~1,000,000 rows and shows max 42s and huge buffer reads — then micro analysis with explain analyze with BUFFERS reveals per-plan I/O (and explains why an expression index helps: mean drops from ~10s to ~1s for some params but some parameter values still force a seq scan). Auto_explain, pg_stat_kcache, pg_qualstats, PF2/explain.dalibo.com, FlameGraphs and a built Database Lab (ZFS/LVM thin clones) let teams test full-size explains safely; note explain logging can add large overhead (reports up to 700x).

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 4:21Seamless scale optimization methodology
  3. 8:21Anti-methodologies in SQL optimization
  4. 12:10SRE methods and problem statement
  5. 14:13Identifying slow queries in practice
  6. 19:57Macro vs micro analysis split
  7. 28:50Macro analysis tools and metrics
  8. 44:13Practical exercise on Catacoda
  9. 55:59Analyzing pg_stat_statements metrics
  10. 1:06:36Micro analysis with EXPLAIN
  11. 1:13:23Observability problems in analysis
  12. 1:24:04Visualization tools for EXPLAIN
  13. 1:33:03Optimizing the slow query
  14. 1:48:27Switching between macro and micro levels
  15. 1:53:04Database Lab for disposable environments
  16. 2:00:27Summary and final thoughts
  17. 2:15:00Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.