PostgreSQL

Foreign key relationships cause quadratic MultiXact member growth under concurrent writes

critical
performanceUpdated Mar 4, 2026
Technologies:
How to detect:

Foreign keys compound MultiXact member consumption. When multiple transactions insert rows referencing the same parent rows, PostgreSQL creates separate MultiXacts for each referenced row. With n backends share-locking a row, PostgreSQL creates O(n) MultiXacts and O(n^2) members (e.g., 5 transactions create 4 MultiXacts with 14 total members).

Recommended action:

Audit foreign key usage, especially on low-cardinality enum tables. Consider removing or restructuring foreign keys on tables experiencing high concurrent insert volume. Monitor member space consumption during bulk insert operations. Evaluate moving high-write workloads off PostgreSQL if foreign key constraints are essential.