Code24Lab
Databases & SQL Advanced

PostgreSQL Mastery: Indexes, EXPLAIN, Partitioning & Concurrency

Read EXPLAIN like the planner, size and choose B-tree, GIN and BRIN indexes, tune statistics, vacuum and memory, partition big tables and reason about MVCC, isolation and locks, with every answer checked as you go.

21 lessons 21 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

This advanced PostgreSQL course trains the skills that separate a database professional from a query writer. In 21 hands-on labs you recompute what the planner does: cost and row estimates from pg_stats, most common values and histograms, and you read EXPLAIN ANALYZE with loops and buffers. You decide between B-tree, multicolumn, covering, partial, GIN and BRIN indexes, tune HOT updates, autovacuum and freezing, trace MVCC visibility, isolation levels, lost updates and lock queues, partition large tables, secure rows with roles and row level security, and size work_mem. A final pg_stat_statements tuning project and an exam lead to your certificate.

Lessons

  1. Reading EXPLAIN: The Planner's Cost ModelLabFree
  2. EXPLAIN ANALYZE: Actual Rows, Loops and MisestimatesLab Locked
  3. EXPLAIN BUFFERS: Pages, Cache Hits and ReadsLab Locked
  4. pg_stats: Most Common Values and n_distinctLab Locked
  5. Histograms: Estimating Range ConditionsLab Locked
  6. B-Tree Index or Seq Scan? The Break-Even PointLab Locked
  7. Multicolumn Indexes and the Leftmost PrefixLab Locked
  8. Covering Indexes, Index-Only Scans and the Visibility MapLab Locked
  9. Partial and Expression Indexes: Index Only What You QueryLab Locked
  10. GIN Indexes for Arrays, jsonb and Full TextLab Locked
  11. BRIN Indexes for Huge Append-Only TablesLab Locked
  12. HOT Updates and FillfactorLab Locked
  13. MVCC: xmin, xmax and Snapshot VisibilityLab Locked
  14. Autovacuum: Thresholds, Scale Factors and Per-Table TuningLab Locked
  15. Freezing and Transaction ID WraparoundLab Locked
  16. Isolation Levels and the Lost UpdateLab Locked
  17. Locks, Lock Queues and Safe MigrationsLab Locked
  18. Range Partitioning and Partition PruningLab Locked
  19. Roles, Privileges and Row Level SecurityLab Locked
  20. work_mem, Spills and the Memory BudgetLab Locked
  21. Final Project: Tuning from pg_stat_statementsLab Locked