DB2 Performance Tuning Principles
Bring together indexing, statistics, isolation levels, and SQL-writing discipline into a coherent approach to diagnosing and fixing slow DB2 queries.
Performance tuning interview questions rarely ask for a single fact — they ask you to walk through an investigative process, and this topic is really about demonstrating that process end to end rather than reciting isolated tips. A strong candidate treats 'this query is slow' as a diagnosis problem with a repeatable sequence of checks, not a grab-bag of unrelated tricks.
Tuning a slow DB2 query is like diagnosing why a delivery route suddenly takes twice as long — you check the map app's chosen route first (EXPLAIN), then whether the map data is current (RUNSTATS/REORG), then whether a shortcut even exists (indexing), then whether the delivery instructions themselves are oddly worded and confusing the app (SQL rewrite), before finally considering whether it's just rush hour traffic everywhere (environmental/concurrency factors).