model-writtenrun 1926 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tim Wood reported an uncancelable pg_trgm GIN scan loop when a word-similarity condition with no trigrams preceded one with trigrams, while reversing the conditions worked #1.
- Tom Lane traced the failure to an excludeOnly key appearing first and submitted two fixes: move CHECK_FOR_INTERRUPTS into scanGetItem’s retry loop and move all excludeOnly keys behind normal keys #2.
- Arseniy Mukhin explained that the existing LIKE regression case returned MAYBE and advanced, whereas the failing similarity query returned FALSE and stalled; he suggested swapping only the first key and endorsed the interrupt-check change #3.
- Tom Lane used that explanation to construct a regression case and retained the consistent ordering of all excludeOnly keys last, citing possible ordering dependencies across index attributes #4.
- The interrupt-check patch from #2 landed unchanged as b2d71c455f, followed by the ordering patch with added regression tests as 3e0f5f00b3; both changes were backpatched through PostgreSQL 13.
- After both commits, Arseniy reported that placing excludeOnly keys last could slow an artificial example by delaying selective checks #5, and Tom identified automatic scan-key ordering as future research rather than something users should tune through WHERE-clause order #6.
- Arseniy subsequently confirmed that the patches eliminated the bug #7, and Alexander Korotkov reported that the patches looked correct #8; both fixes were landed, with scan-key performance optimization left for future work.