model-writtenrun 7476 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pavel Stehule reported that reducing work_mem enough to trigger Result Cache evictions increased query runtime from roughly one second to 57 seconds, and suggested bypassing ineffective caching #1 #2.
- Yura Sokolov identified the assertion-enabled full-cache scan on every eviction as the likely cause, and Tomas Vondra reproduced the slowdown only after enabling assertions; Pavel confirmed that diagnosis #3 #4 #5.
- David Rowley explained that the expensive checks were intended to validate memory accounting broadly, considered removing or conditionally enabling them, and then proposed checking once at executor shutdown instead of adding batch-eviction complexity #6 #8.
- Tomas Vondra initially favored retaining immediate checks to make failures easier to diagnose, but David Rowley submitted a patch moving validation to ExecEndResultCache(), arguing that it also checks executions with no evictions #9 #10.
- Justin Pryzby suggested extracting a reusable checking function for debugging, but David Rowley declined because immediate diagnosis would require checks at every accounting update and the existing updates were already localized #11 #12.
- Yura Sokolov proposed a separate heavy-assertion mode, which David Rowley and Tomas Vondra opposed; Tomas subsequently clarified that he had missed the patch and accepted its benefit of checking executions without evictions #13 #14 #15 #17.
- Pavel Stehule suggested making expensive assertion routines recognizable in profiling output, while Tom Lane supported reducing assertion overhead because slow tests delay developer and buildfarm feedback #18 #19.
- David Rowley committed the sole patchset unchanged as 92c4c269d2 and announced that the proposed fix had landed #10 #20.
- After committing, David Rowley declined special profiling clues for assertion builds; Yura Sokolov and Andres Freund continued discussing acceptable assertion complexity, leaving the specific Result Cache fix landed with no outstanding patch revision #21 #23 #24.