tp wrote: > Hmm,, > > thanks so far, it helped. > > The query is horrible slow on full tables (>100.000 rows). > Is there any other solution? I just want to have the 'next 10 entries' > WHERE state=10 and update state=20. > (so that on the next request i or another process only gets the > new entires in queue). > > > My query now looks like: > UPDATE queue SET state=20 WHERE (id) IN (SELECT id FROM queue LIMIT 10)
Without an ORDER BY, I am not sure what that LIMIT is returning. I don't know of a faster way. -- Bruce Momjian | http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]