model-writtenrun 9898 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Daniel Wood reported nearly twofold variation in read-only pgbench throughput when max_connections changed slightly on a multisocket Skylake system, identifying GetSnapshotData() as the hotspot and reporting some improvement from narrower process indexes #1.
- Andres Freund described similar behavior on older processors and proposed contiguous PGXACT scanning with backends moving into earlier slots; Daniel explored occupancy bitmaps, separate arrays for transaction fields, less frequent xmin updates, and combined accesses while warning about excessive padding #2 #3 #4 #5.
- Adrien Nayrat suggested a possible connection to a PAUSE-related performance issue, but Ants Aasma explained that the reported hotspot and PostgreSQL's retry behavior made that explanation unlikely #6 #7.
- Andres narrowed the immediate proposals to 16-byte PGXACT alignment, cache-line alignment of pgprocnos, removing unnecessary volatile qualifiers, combining flag checks, and allocating lower-numbered process slots first #8.
- Andres implemented the combined GetSnapshotData() flag check as 5fde047f2b, directly following the proposal in #8 and preceding the attached patch.
- Andres then posted a broader volatile-removal patch covering procarray.c and varsup.c, explaining that volatile did not guarantee the ordering needed when publishing subtransaction IDs and replacing that reliance with explicit read and write barriers #9.
- Thomas Munro pointed to his earlier independent patch in thread #36606, and Andres incorporated its missing XidCacheRemove write barrier alongside local cleanup when committing #9 as 450c7defa6 #10 #11.
- The thread ended with Andres explaining why XidCacheRemove's writes needed ordering even though its own reads did not; both targeted changes had landed, while the broader layout, alignment, and allocation proposals had no posted implementation or resolution here #11 #8.