From: Perrin Harkins Date: September 8 2009 1:08am Subject: Re: Queue / FIFO in MySQL? List-Archive: http://lists.mysql.com/mysql/218659 Message-Id: <66887a3d0909071808p73fdfc93s920e64998b7d4adf@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 7, 2009 at 8:18 PM, Allen Fowler wrote: > Note: In this scheme the worker winds up with all "new" records generated since the last worker claimed any. Not sure how else to guarantee atomicity. I would prefer "only n records per request". Ideas? SELECT...FOR UPDATE followed by one or more UPDATEs in a transaction. Either use MIN(id) to get the next lowest id or ORDER BY and LIMIT to get n records at a time. - Perrin