1 year ago

#370860

test-img

Dear Deer

Why Estimated Execution Plan shows clustered index scan instead of table scan?

I have very simple table like this :

enter image description here

It contains only one clustered index on ID column (PRIMARY KEY) as you can see. Data that are stored in that table :

enter image description here

When I do Display Estimated Execution Plan it shows me that it uses clustered index scan for following query :

enter image description here

I'm wondering why SQL engine shows me clustered index scan instead of table scan ? I'm searching via Name column (not ID) and I assume that index does not contain any information about Name data (Name column) - the index is built based on ID column and should operate strictly on ID column if I understand it correctly. So if I'm using only Name column which is not indexed - why it uses clustered index to search the table? I don't get it. I would expect table scan in this case.

sql-server

indexing

sql-execution-plan

sql-server-2019

0 Answers

Your Answer

Accepted video resources