• Yes, that dynamice management view is specifically created to watch fragmentation. the avg_fragmentation_in_percent represents the percentage of logical or extent fragmentation within your index/table. The closer this value to zero, the better. I would start thinking index maintenance when this gets to 10% or more.

    Another value to watch is avg_page_space_used_in_percent. This represents how full your pages are. If your fill factor is set at 80%, this value should be somewhere between 80-100%. If, in this example, you see this value 75% or less, you are seeing the result of page splits (when the page split happens, SQL Server splits off 1/2 of the page so this value will appear between 50% and your fill factor value).

    Reading up on fill factor and internal/external fragmentation in BOL will help you with this.

    Also, Michael was referring to the order of the data, not the columns. For example, if your clustered index was on an int column, you would want to see this:

    INSERT INTO @Table (IntValue)

    SELECT 1 UNION ALL

    SELECT 2 UNION ALL

    SELECT 3

    as opposed to this

    INSERT INTO @Table (IntValue)

    SELECT 3 UNION ALL

    SELECT 1 UNION ALL

    SELECT 2

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden