I have an application which will be reading from a single table, in order to speed up the processing of each row it will run multiple threads, as soon as each thread finishes it will read again from the same table.
My first approach is to select the rows assigned to an index of each thread by using modulus on the where clause
SET @maxThreads = 10
SELECT TOP 1 * FROM Table1 WHERE id % @maxThreads IN (0, @maxThreads)
Any idea how else I can accomplish this?
slow down when you need to hurry, stop when you need to move on,
look back when you need to forget, or you might slip and leave sanity