model-writtenrun 3459 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin opened the thread with intermittent subselect plan failures and diagnostic patches showing that injected cleanup-lock failures could perturb tenk2's tuple estimate and change join order #1.
- Tomas Vondra recommended making test queries resistant to small statistical variations while questioning why a fully sampled table's estimates changed; Tom Lane agreed and suggested investigating cleanup-lock failures and DISABLE_PAGE_SKIPPING #2 #3.
- Richard Guo proposed replacing the subquery's equality with an inequality to prevent semijoin uniquification and constrain the legal join order #4.
- Alexander traced the tuple-estimate drift to the combination of test_setup's VACUUM ANALYZE and sanity_check's later VACUUM, withdrew his initial claim that DISABLE_PAGE_SKIPPING solved it, and linked create_index failures to reduced all-visible page counts #6 #7 #8.
- Tom questioned whether Richard's inequality preserved the intended test coverage and instead proposed retaining the equijoin while adding WHERE a.thousand < 750 to break the cost symmetry #9.
- Responding to Tom's concern about inconsistent initial statistics, Alexander supplied broader cleanup-lock fault injection and create_index diagnostics #10 #11.
- Tom committed his inline restriction as c2df2ed90a, updating the expected plan and cleaning up comments and whitespace; Richard's attached inequality alternative was not used #9 #4.
- Tom then refined Alexander's diagnostic patch, observing missed all-visible markings and suspecting that disproportionately sampling the partially filled last page distorted tuple-density estimates; he reproduced the effects on PostgreSQL 16 and left possible density-estimation changes for further investigation #12 #13.
- At the thread's end, Alexander reproduced create_index failures under concurrent recovery tests on a slow ARMv7 machine and reported that two additional VACUUM ANALYZE calls allowed twenty iterations to pass; the subselect mitigation had landed, but the broader VACUUM and index-only-scan instability remained unresolved here #14 c2df2ed90a.