Query - which index being used?

Jess31
Jess31 used Ask the Experts™
on
When doing a query on a table with multiple indexes how can i know which one SQL is using?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Engineer
Distinguished Expert 2017
Commented:
You need to include the Query Execution Plan. This will give you all the information about your query.
Scott PletcherSenior DBA
Most Valuable Expert 2018
Top Expert 2014

Commented:
You don't even have to actually run the query to get an estimated query plan.

Select/highlight the text for the query, then right-click and select "Display Estimated Execution Plan".  That will tell you want indexes are being used, and the number of rows that SQL estimates will come from each operation.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial