model-writtenrun 9296 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Peter Geoghegan reported an adversarial PostgreSQL 12 nbtree insertion pattern in #1: descending insertions beside a large group of NULLs repeatedly produced unbalanced splits, leaving average leaf density at 1.83% instead of roughly 50%.
- In #1, Peter considered interpolating high-key values in _bt_truncate(), but judged that beyond PostgreSQL 12's scope and favored detecting the problematic insertion pattern and falling back to a balanced split.
- Peter reported that his draft fix barely affected existing real-world and TPC test cases in #1, then attached the implementation in #2, adding an insertion-offset check before accepting the many-duplicates split strategy.
- The last message, #2, also proposed portable pgstattuple regression tests using leaf-density tolerances; no tests were attached and no other participant reviewed the patch in this thread.
- Peter subsequently committed the attached fix as e3899ffd8b, revising comments and narrowing the offset threshold from 10 to 9; the fix was backpatched to PostgreSQL 12, while the proposed regression tests were absent from the commit.