model-writtenrun 8483 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Giuliano Gagliardi reported that concurrent refresh could silently miss a duplicate row containing a NULL outside the unique key, and that adding a nullable unique index caused substantial refresh slowdown #1.
- Rafia Sabih proposed removing the duplicate check's whole-row NULL guards #2; Surya Poondla independently proposed the same change with revised comments and error wording #4, later explaining that mailing-list delays had hidden Rafia's submission from him #5.
- Surya combined the correctness fix with an optimization that skipped nullable indexed columns in the diff join #6; Rafia requested separate patches, regression coverage, and stronger justification of the NULL semantics #7, leading to a split series with a correctness test #9.
- ChangAo Chen questioned the NULL-equality approach #13 and supplied an alternative built-in comparison function that treated NULL fields as unequal during the diff join #14.
- Surya objected that ChangAo's alternative would delete and reinsert every unchanged row containing any NULL #15; ChangAo then demonstrated that Surya's broad duplicate check incorrectly rejected valid repeated rows with NULL unique keys #16.
- Surya accepted the counterexample and rebuilt the precheck using the same per-column index equality operators as the diff join, retaining whole-row image equality and allowing valid NULL-key duplicates; he continued his own series rather than adopting the new comparison function #17.
- Surya rebased the two patches in May #18, and Rafia maintained the series with another rebase in July #19.
- After retesting, Surya found that the guarded performance optimization did nothing because materialized-view columns do not carry the required NOT NULL flags; the earlier unconditional optimization had been fast but incorrect, so he proposed proceeding with the correctness fix separately #20.
- Robert Haas identified the misleading algorithm explanation: only NULLs in usable unique-key columns prevent matching, whereas NULLs elsewhere do not; he recommended a narrowly targeted, backpatchable precheck correction #21. Yugo Nagata supported rewriting the explanation, noted that valid NULL-key duplicates already worked, and suggested explicit NULL tests #22.
- Joao Rito's November testing supported the correctness patch, confirmed that the performance patch did not reduce delete-and-insert churn, and showed that index equality conditions could accelerate the duplicate precheck by enabling a hash join #23.
- Surya submitted a correctness-only revision with explicit unique-key NULL tests, a rewritten algorithm explanation, and expanded tests; he retained index equality conditions for hash-join performance and omitted the ineffective second patch #24.
- Zsolt Parragi found that the explicit IS NOT NULL tests introduced silent data loss for composite keys containing NULL fields, proposed IS DISTINCT FROM NULL, and recommended shortening the error message #25.
- Joao reported successful scalar-key and index-variation tests, supported retaining the hashable equality conditions, and noted that checking previously skipped rows could increase refresh cost; his testing did not establish that Zsolt's composite-key regression was resolved #26.
- Surya reproduced the composite-key regression and submitted IS DISTINCT FROM NULL with a composite-key regression test and shorter error wording #27. The thread ends with that correctness revision awaiting further review, no linked commit, and the original nullable-index performance problem deferred for a different approach.