model-writtenrun 4162 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Richard Guo reported that Memoize could incorrectly cache a lateral join whose parameterized inner scan evaluates random(), reducing calls to the volatile function #1.
- Richard Guo proposed checking ppi_clauses alongside the inner relation's existing restrictions by concatenating the lists in get_memoize_path() #1.
- David Rowley committed the fix with a separate loop over ppi_clauses and an explanatory comment about lateral joins, retaining Richard Guo's authorship and marking it for backpatching through PostgreSQL 14 990c3650c5.
- David Rowley announced the committed variation and explained that combining the restriction lists was unnecessary #2.
- Richard Guo approved the committed variation and thanked David Rowley, closing the thread with the fix landed and no outstanding requests #3.