What every developer should know about SQL performance
You can run many examples from the book online at SQL Fiddle (work in progress). The sections that already have online examples are marked with the SQL Fiddle logo: Try online at SQL Fiddle. Running these examples is as easy as a click.
Preface — Why is indexing a development task?
Anatomy of an Index — What does an index look like?
The Where Clause — Indexing to improve search performance
The Equals Operator — Exact key lookup
Functions — Using functions in the where clause
Bind Variables — For security and performance
Searching for Ranges — Beyond equality
Partial Indexes — Indexing selected rows
Obfuscated Conditions — Common anti-patterns
Testing and Scalability — About hardware
The Join Operation — Not slow, if done right
Clustering Data — To reduce IO
Sorting and Grouping — Pipelined order by: the third power
Partial Results — Paging efficiently
Insert, Delete and Update — Indexing impacts on DML statements