model-writtenrun 9650 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Lane proposed an extensible planner-support API to solve PostGIS's need for derived index conditions and the longstanding lack of function selectivity estimates, repurposing protransform and using support functions attached to operators' implementation functions #1.
- Tom's first series implemented request-based simplification, superuser-controlled CREATE/ALTER FUNCTION attachment, dependency and dump support, and selectivity, cost, and row-count requests; lossy index-condition generation remained unfinished #2.
- Tom added concrete row-count estimators for unnest and integer generate_series, then identified excessive planner-header dependencies and favored a public planner header over centralizing all datatype support functions #3.
- Simon Riggs asked about deriving expression-index matches and ordering information; Tom deferred those broader capabilities beyond the PostgreSQL 12 scope, distinguishing them from extracting index conditions from specialized functions already present in a query #4 #8 #9 #11.
- Robert Haas questioned the expertise required by the C API, while Tom argued that extension authors such as PostGIS could use the built-in support functions as examples #6 #7.
- Tom consolidated the series after planner-header refactoring, incorporated index-path representation work, and added the index-condition request; function-OID aliases led him to use separate LIKE and regex support entry points, while their final source-file organization remained unsettled #12.
- The infrastructure and SQL-attachment portions of #12 landed on February 9 as 1fb57af920, including the prosupport catalog change, simplification API, and dependency handling.
- The estimation and SRF portions of #12 landed later that day as a391ff3c3d; the available earlier SRF patch preserves the committed implementation apart from header changes #3.
- The index-condition portion of #12 landed on February 12 as 74dfe58a59, with separate LIKE and network support implementations; easier extension OID lookup and further selfuncs.c refactoring were explicitly left for separate work.
- After those commits, Paul Ramsey began implementing PostGIS support functions, and Tom explained implicit operator families, separate calls for each matching index, and the requirement that indexable function calls appear in WHERE or JOIN conditions #13 #14 #16 #18 #20.
- Tom clarified that pseudoconstants may reference another table but cannot contain volatile functions or variables from the indexed table, explained the expressions available for cost estimation, and described how index cost comparisons choose among alternatives #22 #24 #26.
- Paul reported an index-column mismatch when generating a condition with the indexed argument on the right; Tom explained the required orientation, and Paul reported that his corrected implementation passed PostGIS regression tests #27 #28 #29.
- At Paul's request, Tom reviewed the PostGIS implementation and supplied checks for pseudoconstant comparison expressions, revised argument ordering, and minor fixes, while separately recommending schema-qualified function lookup #31 #32.
- Paul applied and adjusted Tom's patch and adopted schema-qualified lookup, while retaining unsupported underscore-prefixed functions intentionally so callers could avoid index use #33.
- Further review exposed asymmetric within/contains semantics that Tom's argument-swapping patch had overlooked; Paul cited regression failures, and Tom acknowledged the mistake and proposed argument-dependent strategy selection while questioning coverage of three-argument functions #34 #35 #36.
- The thread ended with the PostgreSQL infrastructure committed and PostGIS integration still being refined: Paul explained why homogeneous argument types and symmetric operators made his implementation work, while Tom urged removing those accidental assumptions before others copied it; improved PostGIS costing remained the next step #33 #37 #38.