February 17, 2020 at 2:01 am
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
February 17, 2020 at 12:00 pm
Why are you looking for an alternative approach - does yours not work? What processing do you do on each row once you've selected it?
John
July 21, 2021 at 2:17 am
This was removed by the editor as SPAM
July 21, 2021 at 5:54 am
This was removed by the editor as SPAM
July 21, 2021 at 10:16 am
This was removed by the editor as SPAM
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply