model-writtenrun 7760 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alexander Lakhin reported that a case-insensitive regular expression with a 500-character fixed prefix triggers a planner assertion failure on PostgreSQL 13.2 in #1.
- Alexander's diagnostic patch in #2 traced the failure to underflow causing a zero-over-zero division in regex_selectivity(), showed that master instead produces an enormous row estimate, and raised the possibility of explicitly rejecting NaN selectivities.
- Tom Lane reproduced the enormous estimate and agreed that a clamp was needed in #3; Alexander clarified that the division produces NaN on both branches but causes an assertion failure on the stable branch in #4.
- Tom committed ae4867ec74, guarding the division against an underflowed zero denominator and arranging backpatches to all supported versions; the attached diagnostic logging was not incorporated.
- After the fix landed, Tom explained in #5 that master's existing handling replaces NaN estimates with 1e100, and questioned both that policy and its EXPLAIN formatting; those broader concerns and Alexander's proposed NaN validation remained unresolved in this thread.