Now let’s move on to multi-table queries. When you join multiple tables together like this, and you’ve got multiple indexes, how does SQL Server choose which index to use? Would it use an index on Comments.UserId, or one on Comments.Score? Or will it use both, since it needs to both filter and sort? Transact-SQL SELECT…
5 Designing Indexes for JOINs
Now let’s move on to multi-table queries. When you join multiple tables together like this, and you’ve got multiple indexes, how does SQL Server choose which index to use? Would it use an index on Comments.UserId, or one on Comments.Score? Or will it use both, since it needs to both filter and sort? Transact-SQL SELECT…
To access this incredible, amazing content, you gotta get Recorded Class Season Pass or Fundamentals of Index Tuning, or log in if you already shelled out the cash.
- 0 Prerequisites Before the Class
- 1 Designing Indexes for the WHERE Clause
- 2 Lab: Indexing for WHERE
- 3 Designing Indexes for ORDER BY
- 4 Lab: Indexing for WHERE + ORDER BY
- 6 Lab – Indexing for Joins
- 7 SQL Server’s Built-In Index Recommendations
- 8 Recap and Next Steps
- Bonus Lab – Getting Index Recommendations and Tuning Them