PostgreSQL Performance Engineering
Advanced planner insight, query tuning, and time-series architecture for high-performance PostgreSQL systems - 2 days
This advanced two-day hands-on course is designed for experienced SQL and PostgreSQL professionals who want to go beyond writing correct queries and learn how to make them fast, predictable, and scalable. The course focuses heavily on PostgreSQL optimization, especially planner behavior, execution internals, indexing strategy, statistics, and performance tuning techniques used in real production systems.
It also covers TimescaleDB from both an implementation and architecture perspective, including hypertable-based design and the role of columnar storage for analytical workloads. The instructor brings over 30 years of industry experience and teaches using practical, industry-demanded content rather than an academic approach.
Learning outcomes
- Read and interpret advanced PostgreSQL execution plans confidently
- Identify root causes of poor query performance
- Understand planner behavior, costing, and row estimation issues
- Tune queries using indexing, statistics, SQL rewrites, and configuration
- Distinguish key plan nodes and know when each is beneficial or problematic
- Design PostgreSQL databases with TimescaleDB implementation in mind
- Use TimescaleDB hypertables, compression, and columnstore appropriately
- Make better architecture decisions for high-ingest and analytical workloads
Prerequisites
- Strong SQL expertise
- Hands-on PostgreSQL experience
- Familiarity with indexes, joins, vacuum, analyze, and partitioning
- Comfortable reading basic EXPLAIN plans
Course outline
- PostgreSQL performance tuning mindset
- Performance goals and bottleneck identification
- Query-level tuning versus workload-level tuning
- Benchmarking and tuning workflow
- PostgreSQL internals that affect performance
- MVCC, heap storage, visibility, and tuple lifecycle
- WAL, checkpoints, autovacuum, and bloat
- Planner and executor deep dive
- Parse, rewrite, plan, execute
- Cost-based optimization fundamentals
- Planning time versus execution time
- Expected row count versus actual row count
- Filtered rows and rows removed by filter
- Join order and join strategy selection
- Reading execution plans effectively
- Cost, rows, width, loops, actual time
- Buffers, I/O, timing, and memory clues
- Finding the first bad estimate
- Diagnosing plan instability and regression
- Understanding critical plan nodes
- Sequential Scan
- Index Scan and Index Only Scan
- Bitmap Index Scan and Bitmap Heap Scan
- Nested Loop, Hash Join, and Merge Join
- Sort, Hash, Aggregate, and Materialize
- Gather, parallel nodes, and Memoize
- Filter versus Join Filter
- Advanced indexing strategy
- Composite indexes and column order
- Partial indexes
- Expression indexes
- BRIN for large time-oriented datasets
- Index bloat, redundancy, and maintenance
- SQL tuning patterns
- SARGability and predicate design
- Join rewrites and pre-aggregation
- Window function performance
- CTE and subquery performance considerations
- Pagination and top-N query strategies
- Memory, parallelism, and execution behavior
- Hash and sort memory usage
- Shared buffers and cache effects
- Parallel query behavior
- PostgreSQL architecture for performance
- Scale-up versus scale-out decisions
- Connection management and pooling
- Read replicas and workload separation
- Partitioning strategy and pruning
- Database design assuming TimescaleDB
- Designing for hypertables from the start
- Time column and partitioning strategy
- Chunk interval design
- Indexing hypertables effectively
- High-cardinality dimension design
- Retention-aware schema design
- Designing for continuous aggregates
- TimescaleDB optimization
- Hypertables and chunk pruning
- Ingestion performance patterns
- Compression and columnstore usage
- Continuous aggregates and refresh strategy
- Retention policies and lifecycle management
- Query patterns for recent versus historical data
- Columnar capabilities and hybrid storage
- PostgreSQL row-oriented fundamentals
- TimescaleDB columnstore for analytical workloads
- When columnstore helps
- When rowstore remains the better choice
- Designing hybrid hot-and-cold data strategies
Practical, connected learning
My wider training approach brings hands-on implementation and systems thinking together, connecting technology with real operational needs.