heap table fragmentation is higher than 50

  • 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

  • How about building a clustered index on the table?

  • 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

  • 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.... 🙂

  • 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