model-writtenrun 1162 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ilia Evdokimov proposed short-circuiting selectivity estimation for large NOT IN or ALL arrays containing NULL, initially using memchr on the deconstructed constant array while leaving nonconstant arrays unchanged #1.
- David Geier questioned the extra scan's cost for ordinary arrays #2, prompting Ilia to use ARR_HASNULL and also stop on NULL Const elements in nonconstant arrays #3; Ilia then moved the constant-array check before deconstruction and reported substantially reduced planning times #4 #5.
- David Geier approved the revised approach and requested regression coverage #6, after which Zsolt Parragi demonstrated that ARR_HASNULL detects a bitmap that can survive replacement of every NULL element and therefore cause an incorrect zero estimate #8.
- David Geier endorsed checking actual NULL contents #10, and Ilia switched to array_contains_nulls() with a regression test extracting estimated rows from EXPLAIN #11; Zsolt approved that correction apart from a missing newline, which Ilia fixed #12 #13.
- David Rowley explored folding these expressions to constants in qualification contexts, where false and NULL both reject rows, but identified the need to propagate expression context through eval_const_expressions(); he also requested a dedicated estimation-test file, reuse of an existing table, and documentation of the strict-operator assumption #14.
- Ilia deferred constant folding to possible separate work and split the submission into a prerequisite test relocation plus the optimization, reusing tenk1 and explain_mask_costs() and documenting the strictness assumption #15.
- After Ilia rebased the series #16, David Rowley committed its test-relocation portion as 374a6394c6, renaming the destination planner_est.sql to accommodate width estimates too, and supplied the rebased optimization remainder #17.
- Ilia replaced the test for an array whose NULL had been removed because he considered its exact selectivity estimate potentially unstable, instead testing NULL-only, constant-array, and mixed constant/nonconstant cases #18.
- David Rowley committed the optimization from #18 as c95cd2991f, retaining its logic while clarifying comments, dropping a redundant test, and using EXPLAIN without ANALYZE; his final message confirms both submitted changes had landed, with constant folding left as future work #19.