stubs
stubs

Reputation: 264

Using INCLUDE in Indexes

I have a query on indexes I could not find a confirmation on (possibly due to bad wording).

I have a table T, with columns A, B & C. If I were to create an index on column A, that includes column B, I am given to understand that this is ideal for a query that filters/groups/sorts on A, and select B.

However, for other columns (example select column C), does it work like a regular index on column A without the includes?

Would appreciate any help on this.

Thanks.

Upvotes: 0

Views: 38

Answers (1)

PacoDePaco
PacoDePaco

Reputation: 699

Your question points to difference between covered and non-covered queries. There are quite a few issues to this problem - I would advise reading this article. Query execution plan is chosen after considering a few conditions, so there is no straight away answer to your question.

Upvotes: 1

Related Questions