• Grant Fritchey (8/16/2014)


    ScottPletcher (8/15/2014)


    What is(are) the clustering column(s) on the table? You need to read each 1/4 of the table at a time using the appropriate clustering key range.

    What are there nonclustering indexe(es)? (in case they are needed to determine the clustering key ranges).

    Based on the structure posted above, it's an ID/Value table and the cluster is on the ID. With that kind of structure and the data volumes we're talking about, I'm still back to questioning the need for moving the entire table around, let alone tuning that.

    Sorry, didn't see that.

    Assuming you can accept "close enough" to 1/4, rather than needing an exact 1/4, you could get the min and max, take the diff, divide by 4, and read each 1/4 range of ids. Be sure to explicitly specify id BETWEEN @id_start_of_fourth AND @id_end_of_fourth.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.