Anonyo Sanyal
Almost every slow query is a story about a piece of software believing something untrue about your data.SQL Optimization teaches you to think the way a query optimizer thinks - not its rules, which differ across PostgreSQL, Oracle, SQL Server and MySQL and change with every version, but the method underneath. Across thirty-two chapters it builds from what an index actually is, through cardinality estimation, join strategy, memory grants and parallelism, to why a distributed join moves terabytes it never needed to touch.Twenty-two real investigations show the method working, including six where the obvious answer was wrong. 179 original diagrams make the mechanisms visible. Every claim carries a label - documented, measured, or inference - so you always know which you are reading, and nothing is asserted that you cannot go and check.For engineers who inherited a database and a problem, and for anyone tired of adding indexes hopefully.