Re: Hash index inserts serialise on the metapage tuple counter

From: Greg Burd <greg(at)burd(dot)me>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: geidav(dot)pg(at)gmail(dot)com, michael(at)paquier(dot)xyz
Subject: Re: Hash index inserts serialise on the metapage tuple counter
Date: 2026-11-04 18:23:50
Message-ID: aut2A7twIualK07J@floki
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

v4 attached, on eaa5961efc6. Only the tests changed; cfbot failed v3
on two of them.

0001: 001_concurrent_inserts.pl runs eight pgbench --connect clients
against a node set up with allows_streaming, which sets
max_connections = 10. A client can open its next backend before the
last one has exited, so on the slower Autoconf and 32-bit tasks some
connections failed with "too many clients already". The test now sets
max_connections = 30.

0002: with 4-byte MAXALIGN a hash index tuple is 12 bytes, not 16, so
the fill factor is 384 instead of 307. The 6000-row table then got 16
buckets instead of 32, the inserts split the index, and the function
that walks the overflow pages ran into bucket pages ("invalid overflow
block number"). The test now uses 6600 rows, which gives 32 buckets
with either alignment, and prints whether a group of pages has more
than one page rather than its exact size, which depends on how many
tuples fit on a page.

-greg

Attachment Content-Type Size
v4-0001-Don-t-make-hash-index-inserts-serialize-on-the-me.patch text/plain 35.9 KB
v4-0002-Allocate-and-free-hash-overflow-pages-without-the.patch text/plain 42.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Borodin 2026-11-04 18:28:00 Re: PG19 regression in ecd9288624a: JSON_ARRAY() indexes that go stale
Previous Message Andres Freund 2026-11-04 18:11:17 Re: Fix cumulative WAL statistics double-counting from parallel workers