Efficient way for storing lists in PostgreSQL - Mailing list pgsql-novice

From Marco Tosato
Subject Efficient way for storing lists in PostgreSQL
Date
Msg-id CALTrA_9+u4frAun6HR++qSQFKcMC=hmN68NbUTBV73nU+R5Ccg@mail.gmail.com
Whole thread Raw
List pgsql-novice
Hello everyone!

I'm looking for an efficient way of storing lists in PostgreSQL, the lists will be used as partof a job management sistem, at least the ID of the job must be stored inside the list.

Each list stores jobs with common characteristics (i.e. same level of priority).

The system should satisfy the folloqing requirements:

- lists gets updated frequently removing from the front and adding to the end

- there are many clients constantly modifying the lists (some clients are "job submitters" others are "workers") ....possibly hundred of clients

My first idea was to use a table to store each list as a row, the list itself would the stored inside an array field. This setup would allow the system to update lists locking only a single record instead of locking the entire table when inserting or removing one job from a queue.

What do you thing about using a PG array to manage a queue? Is it efficient or should I store the nodes of the queues as records inside a table?

Thanks a lot to everyone!

Marco

pgsql-novice by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Question about Logical Replication
Next
From: Efraín Déctor
Date:
Subject: Re: Question about Logical Replication