• ma (9/7/2009)


    Now that's interesting. I filled "t" with your script. Including my initial data, there are 10288 rows. I ran the four queries and still get the only table scan on #4. This is on SS2008 Developer Ed.

    Did you rebuild the index?

    What I found was:

    Initial conditions:

    1) Index Scan

    4) Table Scan

    After adding 10001 rows:

    1) Index Scan

    4) Index Seek & RowID lookup

    After rebuilding index

    1) Table Scan

    4) Index Seek & RowID lookup