Fillfactor, Indices and Tables, oh my!

  • Ok, so I have an interesting issue.

    I've got a 10,000,000 row table, that had its fillfactor on its indices set at 15... which led to 8 gigabytes of index data. Yuch.

    I reconfigured to 90% fillfactor, dropped and rebuilt the indices.

    Now... when I run a dbcc showcontig on any individual index, it shows 90% page density. But.. if I run a dbcc showcontig on the table itself, it shows a 6% page density.

     

    What's up with that? How can I change the table's inherent fill-factor? Can you even do that? Am I misinterpreting the data?



    David W. Clary
    MCSD
    Data Miner 49er
    Sr. Database Administrator, Ceiva Logic

  • Do you have a clustered index on the table, and if so, did you set the fillfactor on it also ? What is the rowsize of the table ?

     

  • object id

    index namelevelpagesrowsavg free bytesavg densityscan densityLogical FragExtent Frag
    picture_box0906987108992527602.3216.07461393.746330.2866630.331578
    picture_boxpicture_box_ie152840410899266805.26490.051197.261022.82E-0254.89207
    picture_boxalbum_id62704310899267841.37489.6049796.849040.04067678.81904
    picture_boxalbum_content_id73286410899269799.71990.1196197.184768.22E-0250.22997
    picture_boxpicture_box_content_id102244110899271810.70789.9838699.116923.12E-0245.49326
    picture_boxpicture_box_container_type_id112253010899269839.49289.6282296.638080.04882475.95204
    picture_boxpicture_box0123883010899269798.00390.1408198.79912.06E-0256.01966

     

    Above is the pertinent information from DBCC SHOWCONTIG WITH TABLERESULTS, ALL_INDEXES

    as you can see, object picture_box -- with no index name, is gargantuan in its # of pages, but with only 6% density.

    None of these indexes is clustered. Picture_box is a heavily used table with multiple (in the 10s of thousands) additions and deletions a day.



    David W. Clary
    MCSD
    Data Miner 49er
    Sr. Database Administrator, Ceiva Logic

  • FillFactor only applies to indexes. So for a table with no clustered index, the table data pages aren't affected as you've seen. If you create a clustered index with fillfactor 90, this will solve the problem - but will also require careful selection of the clustered index column or columns.

  • I'll give that a try. Thanks.



    David W. Clary
    MCSD
    Data Miner 49er
    Sr. Database Administrator, Ceiva Logic

  • Remember, though, that when you add/rebuild a clustered index, ALL the other indexes get rebuilt at that time, so in order to avoid a huge performance hit, you should drop the other indexes first, build the clustered index, then rebuild all the non-clustered.

     

  • LOL... too late! That's ok, rebuild time was just 19 minutes. I told Customer Service to go to lunch

     

    And... pages are down to 60K, instead of 900K.

     

    Thank you very much.

     



    David W. Clary
    MCSD
    Data Miner 49er
    Sr. Database Administrator, Ceiva Logic

  • See if this provides additional information:

    http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspx

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply