model-writtenrun 7314 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hung Nguyen reported that upgrading from PostgreSQL 11 to 14 made an equality join slow because the planner preferred a trigram index over a B-tree index after trigram indexes gained equality lookup support #1.
- Tom Lane requested supporting evidence, while Julien Rouhaud asked for schema definitions, execution plans with and without the trigram index, and planner settings to explain the unexpected choice #2 #3.
- Ronan Dunklau supplied a reproducer showing roughly 6.5 seconds with GIN versus 18 milliseconds with a B-tree and Memoize, identifying missing GIN descent CPU costs that became conspicuous when nested-loop caching reduced estimated I/O costs #4.
- Tom suggested examining CPU costing across non-B-tree indexes; Ronan explained that GiST and SP-GiST already charged descent costs and considered hash, BRIN, and bloom investigation outside this bug report's scope #5 #6.
- Ronan posted a tentative patch using B-tree-like descent costs multiplied by searched entries and an estimated tree height, leaving uncertainty about the searched-entry calculation at the thread's last message #7.
- Development continued in thread #46348, whose later submission #522037 supplied the GIN-costing changes committed by Alexander Korotkov as cd9479af2a, replacing the previous attribution to this thread's tentative patch.
- The committed version used page CPU charges, handled array scans, and separated per-entry from per-tuple costs; it was deliberately not backpatched to avoid unexpected plan changes in stable releases cd9479af2a.