PostgreSQL 19’s practical gains include faster bulk inserts with foreign keys and improved planning for certain `NOT IN` queries. In tests comparing 18.6 and 19.0, inserting 100,000 rows with a foreign key took 119 ms instead of 202 ms, while the same insert without the constraint improved only slightly. The foreign-key improvement came from checking the parent’s unique index directly; it does not cover partitioned parents or temporal foreign keys, and child-side indexes remain important for deletes. A query finding missing IDs ran 24.5% faster because PostgreSQL 19 converted eligible `NOT IN` queries into a Hash Anti Join. That rewrite is unavailable when nullable values could change `NOT IN`’s meaning.
The upgrade also adds a built-in concurrent `REPACK` command to reclaim disk space without blocking ordinary reads and writes, though it needs extra disk capacity and a brief exclusive lock for its final swap. New planner-advice modules let developers inspect and test alternate query plans, and `ON CONFLICT DO SELECT` can return an existing row without a second query. `WAIT FOR LSN` lets applications wait for a replica to replay a recent write before reading it. Before upgrading, test a restored database, verify extension compatibility, remove the obsolete `io_workers` setting, benchmark analytical workloads because JIT is disabled by default, and review custom lock settings because the default lock capacity has doubled.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.