model-writtenrun 9840 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Pavel Stehule reported that filtering information_schema.tables by table_name failed to use the pg_class.relname index, making customer queries slow #1.
- Tom Lane traced the problem to domain coercion and the underlying cast to varchar, then posted three experimental patches adding name/text comparisons, simplifying unconstrained domain coercions, and transforming textual equality into indexable name comparisons; the resulting plan used an index but retained a redundant filter and inaccurate selectivity #2.
- Andres Freund questioned the special-purpose planner transformation and discussed simplifying domain checks; Tom Lane kept the immediate scope to unconstrained domains, with plan invalidation required before that optimization could be committed #3 #4 #5 #6.
- Robert Haas challenged reliance on invalidation without locking, and Tom Lane's testing identified repeated execution of generic prepared plans within one transaction as a case that could miss invalidation processing #8 #10 #11.
- The invalidation discussion considered checking cached-plan dependencies and processing invalidations at statement startup, while recognizing that relation locking and privilege changes complicated replacing the existing calls; no final implementation was posted in this exchange #12 #13 #14 #15.
- After reporting that prerequisite improvements had landed, Tom Lane replaced the proposed indxpath.c workaround with an inline change making sql_identifier a domain over name, arguing that it both removed the obstructing varchar cast and enforced PostgreSQL's identifier length limit #16.
- Pavel Stehule raised comparisons against text expressions such as lower('somename'), and Tom Lane demonstrated that the inline change still produced a pg_class index scan for that case #17 #18.
- While auditing conversions to sql_identifier, Tom Lane found that concatenating a function name and OID could exceed the identifier limit, and proposed a C helper that would shorten only the name portion to preserve uniqueness #20.
- Tom Lane committed the new nameconcatoid helper and its information_schema call sites as 5bbee34d9f, followed by the inline domain-definition change and a catalog-version bump as 7c15cef86d; both changes arose from discussion after the attached experimental series.
- By the final message both candidate fixes had landed, while Greg Stark's suggestion to make name storage compatible with varchar from the planner's perspective remained an unimplemented alternative #21.