PostgreSQL Advisory Locks vs SELECT FOR UPDATE for Job Queues
For a job queue in PostgreSQL, SELECT FOR UPDATE SKIP LOCKED inside a transaction is usually the simplest and safest way to let many workers claim jobs without...
104 results for "PostgreSQL"
For a job queue in PostgreSQL, SELECT FOR UPDATE SKIP LOCKED inside a transaction is usually the simplest and safest way to let many workers claim jobs without...
PostgreSQL creates an index on the referenced primary key but not on the foreign key column that points to it. Without an index on the referencing column,...
Partitioning a large PostgreSQL event table by time splits it into smaller child tables, usually one per day or month. The main benefits are fast data...
Row-level security adds database-enforced row visibility policies but does not remove the need for application authorization. Begin with an invariant that the...
CREATE INDEX CONCURRENTLY reduces blocking of ordinary writes, but has special transaction and cleanup constraints. Begin with an invariant that the service...
Exclusion constraints can prevent overlapping reservations across indexed ranges directly in the database. Begin with an invariant that the service must...
To read a PostgreSQL query plan, compare estimated rows with actual rows, find the node where most of the time is spent, and check how rows are scanned and...
Use normalized columns for data you filter, join, sort, or constrain regularly, and use JSONB for genuinely variable or sparsely used attributes. JSONB is...
PostgreSQL connection poolers offer session, transaction, and statement pooling, and the mode you pick determines which features still work. Transaction...