PostgreSQL

PostgreSQL Practice: Job Queues and Partial Indexes3

Start with two rows and two sessions to see what happens to each claim after commit or rollback. Then use PGlite to check when a partial index removes the sort from a pending-job query.

Start with two workers

Follow the locks and status changes for two jobs.

  1. A PostgreSQL SKIP LOCKED job queue: what if a worker dies?

    Claim jobs from two sessions and see which job becomes available again after a rollback and which stays running after its worker disconnects.

Compare query plans

Check the scan and sort when the query reads the oldest pending rows.

  1. How much does a partial index help when completed jobs pile up in PostgreSQL?

    Compare the plans and buffer counts for finding the oldest pending jobs before and after indexing just the pending rows.

Spring Boot deployment practice