March 21, 2014 at 2:46 pm
Hi,
I am doing sp tuning. It has several lines. SO I divided into several small queries and executed individually and check the execution plans. In one small query, I found table scan is happening. That query is basically retrieving all columns from a table but the table doesn't have any pk or Indexes. So is it better to create non-clustered index to remove table sca
March 21, 2014 at 2:51 pm
It depends, I would add a clustered index before thinking about a non-clustered one. It depends as well on the size of the table and the columns and rows used (sometimes a table scan is exactly what you need).
March 21, 2014 at 4:08 pm
Yeah, I'm with Luis. Most tables should have clustered indexes. Since it stores the data, it should generally be the primary path to the data. That's not necessarily the primary key, but it frequently is.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply