• ben.brugman (1/7/2013)


    Lynn Pettis (1/7/2013)


    You index is a clustered index meaning that both queries use the clustered index.

    The code for a Heap situation is included in the code as wel.

    I should have made the Heap the default, sorry for that.

    (heap is build, dropped, cluster is build. commenting out the drop and the cluster build will give the Heap situation).

    With the size's provided the cluster does do a clustered search but there is a difference in efficiency. Because there is no other index on the cluster the access will offcourse be a cluster scan. (complete or part).

    But cluster should not have been de default in the script. :doze:

    I included the clustering, to check for performance on that as well.

    Thanks for your time and attention,

    Sorry to have choosen the wrong default.

    Ben Brugman

    Taking a closer look at your code I see that now. You tell us to run your code from further below. Sorry, I missed that. I did a copy/paste/run of your code as is. Perhaps you should put your test code where it is needed instead of relying on us to move code around for you.