Re: Multithreaded queue in PgSQL

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Nikola Milutinovic <alokin1(at)yahoo(dot)com>
Subject: Re: Multithreaded queue in PgSQL
Date: 2008-06-10 10:54:54
Message-ID: 200806101254.57397.dfontaine@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le mardi 10 juin 2008, Nikola Milutinovic a écrit :
> 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".

You may find that the PGQ component of skytools is what you want:
http://pgfoundry.org/projects/skytools
http://skytools.projects.postgresql.org/doc/
http://skytools.projects.postgresql.org/doc/pgq-sql.html

And there's even a nice and recent presentation paper about it:
http://www.pgcon.org/2008/schedule/events/79.en.html

And a less recent but still useful blog entry on the subject:

http://kaiv.wordpress.com/2007/10/19/skytools-database-scripting-framework-pgq/

Regards,
--
dim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message IPS 2008-06-10 11:04:03 Query on Oracle 10g Merge Function equivalent command/function in Postgre
Previous Message Mattias.Arbin 2008-06-10 10:48:28 Re: Insert into master table ->" 0 rows affected" -> Hibernate problems