Plate III · Filed under
Databases
Databases
4 entries
- 001
Postgres as a job queue with SELECT FOR UPDATE SKIP LOCKED
You do not need a second system for background jobs. How SKIP LOCKED turns a table into a queue, and the details that decide whether it holds up.
PostgreSQLDatabasesBackendQueues - 002
PostgreSQL composite indexes: which column goes first
A multicolumn B-tree sorts by its first column, then its second. Why (a, b) and (b, a) are different indexes, and the rule that decides the order.
PostgreSQLDatabasesIndexingPerformance - 003
UUID primary keys and write amplification in PostgreSQL
A UUIDv4 primary key scatters every insert across the B-tree, turning one logical write into several physical ones. The mechanism, and when it matters.
PostgreSQLDatabasesUUIDPerformance - 004
Keyset pagination vs OFFSET in PostgreSQL
OFFSET reads and discards every row it skips, and silently duplicates records when data shifts. Keyset pagination fixes both, at a price worth knowing.
PostgreSQLDatabasesAPI DesignPagination