December 1, 2014 at 5:49 am
i have bunch of heap tables and the fragmentation seems to be high, i am not sure whether i shall add index for them, as these tables are inserted and updated every day.
thanks
December 1, 2014 at 6:43 am
How about building a clustered index on the table?
December 1, 2014 at 8:50 am
On most systems, most of the time, the vast majority of tables should have, at minimum, a clustered index. I'll bet if you put it on the right place, in addition to being able to defragment (only an issue if you're doing scans, not that big a deal for point lookups, although, a lot more so for heaps), you'll see other performance benefits.
"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
December 2, 2014 at 12:14 am
Grant Fritchey (12/1/2014)
On most systems, most of the time, the vast majority of tables should have, at minimum, a clustered index. I'll bet if you put it on the right place, in addition to being able to defragment (only an issue if you're doing scans, not that big a deal for point lookups, although, a lot more so for heaps), you'll see other performance benefits.
Certainly far more descriptive than my answer.... 🙂
December 2, 2014 at 5:51 am
kevaburg (12/2/2014)
Grant Fritchey (12/1/2014)
On most systems, most of the time, the vast majority of tables should have, at minimum, a clustered index. I'll bet if you put it on the right place, in addition to being able to defragment (only an issue if you're doing scans, not that big a deal for point lookups, although, a lot more so for heaps), you'll see other performance benefits.Certainly far more descriptive than my answer.... 🙂
Ha!
Well, I obviously completely agree with your answer. I just try to tell people why too (although we could certainly add even more detail to this).
"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 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply