Re: Multithreaded queue in PgSQL - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Multithreaded queue in PgSQL
Date
Msg-id dcc563d10806100757v4827f977rddf0f1c181628f27@mail.gmail.com
Whole thread Raw
In response to Multithreaded queue in PgSQL  (Nikola Milutinovic <alokin1@yahoo.com>)
List pgsql-general
On Tue, Jun 10, 2008 at 4:40 AM, Nikola Milutinovic <alokin1@yahoo.com> wrote:
> Hi all.
>
> This may be trivial, but I cannot find good references for it. The problem
> is this:
>
> Suppose we have one table in PgSQL which is a job queue, each row represents
> one job with several status flags, IDs,... Several processes will attempt to
> access the queue and "take" their batch of jobs, the batch will have some
> parameterizable size. So, the simple idea is "select N lowest IDs that do
> not have a flag <in process> set and set the flag", "then proceed with
> whatever it is that should be done".

Do the jobs HAVE to be assigned sequentially in groups?  I.e. is it
only allowable to assign jobs 1-10 to one thread, then 11 through 18
to the next?  Or could you assign 1,2,3,6,7,8,9,10 to one, and
4,5,11,12... to another?

If so, assign them with a separate sequence.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: REGEXP_REPLACE woes
Next
From: Richard Huxton
Date:
Subject: Re: encoding confusion