model-writtenrun 4512 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Feb - Apr 2024 · 7 entries
- Teodor Sigaev opened the thread with two optimizations for workloads creating many temporary tables: a relation-to-type map for relcache invalidation and hash-value-restricted scanning for type-cache invalidation, since catalog lookups are unavailable outside transactions #1.
- After Aleksander Alekseev encountered overlapping patches, Teodor combined them in #3; Aleksander then reported a roughly 150-fold benchmark speedup and supplied assertion, naming, and comment improvements #4 #6.
- Tom Lane explained that a zero hash signals whole-cache invalidation, and Teodor confirmed that an actual zero hash harmlessly causes a full flush; Aleksander documented that convention and approved the patch #7 #8 #9.
- Teodor extended the same scanning technique to the attribute-options cache in #10, creating another consumer of the proposed API.
- Michael Paquier requested separation of the independently useful dynahash refactoring, scan API, and cache changes; Teodor split the series while defending a shared hash_seq_search() interface to avoid duplicating callback loops #11 #12.
- Michael extracted and adjusted the bucket-lookup helper in #13, which landed as cc5ef90edd; Teodor then rebased the remaining work in #16.
- Roman Zharkov tested the relation-map component and proposed consolidating domain invalidation in its helper, while Andrei Lepikhov supplied naming fixes and raised concerns about stale mappings, OID reuse, and cache bloat #17 #18.
Aug - Oct 2024 · 17 entries
- After a four-month gap, Alexander Korotkov resumed the series, placing the simpler hash-scan changes first and redesigning relation-map maintenance so mappings exist only while their type entries retain relevant cached information #19.
- The API and callback optimizations from #19 landed separately as d0f020037e and 40064a8ee1, with declaration formatting and small comment corrections.
- Alexander left domain-type iteration and deletion of main type-cache entries outside this work, explaining that automatically generated composite types were the immediate performance problem #19.
- The remaining relation-map patch returned in #20; Pavel Borisov identified redundant assertion checks and naming issues, and Pavel and Andrei reviewed the resulting implementation before final comment cleanup #21 #23 #24 #25.
- The relation-map optimization landed unchanged from #25 as c14d4acb81.
- Alexander Lakhin reproduced an assertion failure under CLOBBER_CACHE_ALWAYS, revealing that invalidation could occur while lookup_type_cache() was still filling an entry #26.
- Alexander Korotkov concluded that the map-maintenance design had missed concurrent invalidation and reverted the optimization with 8daa62a10c, as announced in #28.
- Andrei questioned whether a redesign was necessary, but Alexander explained that repairing eager insertion would require tracking every relevant flag and tuple-descriptor assignment, and considered retrying construction after invalidation #29 #30 #31.
- Alexander abandoned the retry approach because dependent types complicated reconstruction, instead posting a documentation patch and a redesigned implementation that tracks in-progress type OIDs and completes map insertion on normal return or transaction cleanup #33.
- Andrei raised broader questions about operator-cache consistency, and Alexander clarified that this series would document existing behavior and preserve relation-map consistency rather than solve every possible concurrent catalog-change issue #34 #35.
- Artur Zakirov tested the redesigned series and found that its in-progress array could be allocated before CacheMemoryContext existed; Alexander corrected the initialization order and explained why domain handling remained separate #36 #37.
- Jian He tested the cleanup path and questioned its coverage, while Andrei reproduced a NULL-entry crash and supplied a fix; Alexander incorporated the fix with the guard placed in the finalization routine #38 #43 #44.
- Alexander initially expected CLOBBER_CACHE_ALWAYS to cover interrupted lookup, then recognized that an explicit error was required and added an injection-point regression test #45 #46 #47.
- Dagfinn Ilmari Mannsåker proposed using PostgreSQL's list infrastructure, then withdrew the objection after discussion established that repeatedly emptying the list would cause unwanted allocation churn #48 #50 #52 #54.
- Final review corrected a comment typo, the test module's EXTRA_INSTALL setting, and documentation wording; Alexander also reported successful CLOBBER_CACHE_ALWAYS testing before posting the final series #53 #55 #56 #57 #58.
- The documentation component of #58 landed unchanged as c1500a1ba7, and its redesigned implementation, transaction cleanup hooks, and injection-point tests landed unchanged apart from rebasing as b85a9d046e.
- Andres Freund reported that the injection point leaked into concurrently running tests; Alexander made the test's injection points process-local in aa1e898dea and explained the cause #59 #61.
Apr 2025 · 2 entries
- In April, Noah Misch noticed that TypeCacheOpcCallback() cleared operator flags without maintaining the relation map; Alexander could not reproduce a concrete failure but posted a defensive fix to preserve the intended invariant #62 #64.
- The callback-maintenance fix landed with comment-only edits as bb78e42678; Noah approved it afterward, and the thread ended with the submitted work landed and no replacement series awaiting review #65 #66.