getnobody.org / labs

Postgres 19 foreign key fast path

Everything behind the post How Postgres 19 checks foreign keys without running SQL.

Files

Raw results (ms per 1M-row insert)

Run it

git clone --depth 1 --branch REL_19_STABLE https://github.com/postgres/postgres.git src-REL_19_STABLE
docker build -f Dockerfile.rel19 -t lab/pg:rel19 .
./run.sh pg18.6 postgres:18.6
./run.sh rel19 lab/pg:rel19 bash -c '[ -f /data/PG_VERSION ] || { initdb -D /data >/dev/null && echo "host all all all trust" >> /data/pg_hba.conf; }; exec postgres -D /data'

Tested with Docker on an Apple M-series laptop, 4 CPUs and 4 GB per server, one server at a time. Commits: REL_19_STABLE 8fbbb338be, master 4545cee.