model-writtenrun 7630 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
May 2020 - Apr 2021 ยท 18 entries
- Atsushi Torikoshi proposed tracking generic and custom plan usage in pg_stat_statements because existing planning and execution counters could not reliably identify the chosen plan type #1.
- Legrand proposed distinguishing statistics entries by plan type #2, while discussion of executor hooks and QueryDesc exposed difficulties carrying that information to statistics collection #3 #4 #5.
- Kyotaro Horiguchi suggested exposing existing plan-cache information through pg_prepared_statements #6, and Torikoshi agreed to implement that simpler session-local feature before returning to instance-wide statistics #7.
- Horiguchi supplied counters, costs and plan-generation information in #9, while Tatsuro Yamada independently supplied a boolean indicating the existence of a cached generic plan in #10.
- Torikoshi explained that a cached generic plan could exist even when a custom plan was chosen, then extended Horiguchi's patch with explicit last-plan tracking #11; he subsequently removed costs and generation information and exposed separate generic/custom counters #12.
- Masahiro Ikeda corrected an outdated function comment #13, and Horiguchi requested a clearer last_plan_type name and switch-based conversion #15; Torikoshi incorporated those refinements in #14 and #16.
- Fujii Masao questioned the usefulness of last_plan_type compared with the two counters #17 #19, leading Torikoshi to remove that column and its tracking code in #21.
- Fujii requested integration with the existing plancache regression tests #22, Torikoshi moved the tests #23, and Fujii added final documentation and forced-custom test refinements #24.
- The pg_prepared_statements counters landed unchanged from #24 as d05b172a76, with Torikoshi and Horiguchi credited as authors; Fujii announced the commit in #25.
- Torikoshi then began a separate pg_stat_statements prototype that put plan type in the hash key and obtained it from CachedPlan through ActivePortal during ExecutorStart #27.
- Fujii found a CREATE EXTENSION failure and objected that separate entries could increase eviction and complicate configuration changes #28; Torikoshi fixed the SQL signature mismatch in #30, while Legrand defended separate measurements as useful for diagnosing slower generic plans #29 #32.
- Torikoshi replaced separate hash entries with generic/custom call counts and timing statistics inside each entry #34, and Legrand suggested separate views or generic-only counters to reduce the expanding interface #35.
- Discussion broadened to retaining actual plans because each plan type could encompass multiple execution plans #36 #37; Yamada reported regression failures #40, Fujii raised memory costs #41, and Horiguchi recommended keeping the contrib feature simpler #43.
- In January, Torikoshi reduced the proposal to one generic_calls counter, arguing that historical comparisons could reveal changes in plan selection without separate timing statistics #44; Chengxi Sun reported testing it #45, and Yamada supported its diagnostic use #50.
- Horiguchi identified incorrect plan-type state across nested portals #46 and explained how the inner portal's value leaked into outer execution accounting #52; Torikoshi attempted to save and restore the previous value in #53.
- Fujii found an undercount of ordinary generic executions and missing counts for EXPLAIN ANALYZE #55; Torikoshi corrected accumulation, moved plan-type tracking into plancache.c with restoration in PortalDrop, and added regression coverage in #56.
- After Fujii reported a Windows build failure #57, Torikoshi added PGDLLIMPORT declarations in #58.
- Fujii then demonstrated that executing a PL/pgSQL function caused unrelated utility commands to acquire generic_calls counts #59; Torikoshi acknowledged the bug and withdrew the pg_stat_statements patch because he could not fix it during that commitfest #60, leaving only the pg_prepared_statements feature landed.