Help me understand a step in an Execution Plan (actual) on SQL Server 2019

Nick Ryan 261 Reputation points
2023-10-19T02:21:24.3+00:00

Just when I think I understand Execution Plans a little, I have something like this.

For this Index Scan
User's image

The object shows that the index it's using is one that has the column RUN_TIME in it, only. No Includes. The output list is a bunch of columns on the table but not in that index. Where do they come from? I was sure that it would have to do a Key Lookup to get those.

SQL Server | Other
0 comments No comments
{count} votes

Accepted answer
  1. Dan Guzman 9,406 Reputation points
    2023-10-19T03:06:17.9933333+00:00

    A non-clustered index contains:

    • index key columns
    • included columns (if specified)
    • clustered index key columns (as the row locator)

    Your query apparently doesn't need any other columns, so the non-clustered index will cover the needs of the query and avoid the need for a key lookup to retrieve additional data.

    See Nonclustered index architecture for details.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.