I already had tried to mark the rows as soon as a client has got them, but its not fast enoughMark the rows first with the client id then retrieve the rows to the client.
JimFive: the query "SELECT Rand(), * FROM rowpool order by 1 limit 1,25;" gives me an error.Ok, I looked it up, in mysql you use: SELECT * FROM rowpool order by RAND() limit 25
Regarding "update table set processing = myclientid" - how do I update just 25 next records that do not have processed = 1 without the other clients interfering?
UPDATE tablename
SET processing = myclientID
WHERE tablename.processed = 0 and tablename.processing =0
LIMIT 25
Alternatively, give each client a number from 0 to numclients-1 and only allow them to get rows where the rowid mod numclients = their own number
Finally, to answer the asked question:
write a query that returns the top 25 rows ordered by a column of random numbers.
something like:
SELECT Rand(), * FROM TABLE order by 1 limit 1,25