Apr - May 2020

2 commits
Simplify cost_incremental_sort a bit
1 May 2020Tomas Vondramaster13beta1REL_19_STABLE13beta1REL_18_STABLE13beta1REL_17_STABLE13beta1REL_16_STABLE13beta1REL_15_STABLE13beta1REL_14_STABLE13beta1REL_13_STABLE13beta1Also in: Remove unnecessary relabel stripping (landed as posted)
Fix cost_incremental_sort for expressions with varno 0
22 Apr 2020Tomas Vondramaster13beta1REL_19_STABLE13beta1REL_18_STABLE13beta1REL_17_STABLE13beta1REL_16_STABLE13beta1REL_15_STABLE13beta1REL_14_STABLE13beta1REL_13_STABLE13beta1
LLM analysis, 100% suremodified before commitmoderate changesfrom patchset #30 of 3 reviewers saw the final version

The commit retains the cost_incremental_sort guard from #3, but uses pull_varnos to detect nested Vars and Min(input_tuples, DEFAULT_NUM_DISTINCT) for the fallback. It also expands comments and adds incremental_sort regression coverage, matching Tomas Vondra's explanation in #22.

  • Justin Pryzbysaw an earlier versionLLM analysis, 99% sureBeyond reporting the bug, Justin tested #3, confirming that the reproducer stopped crashing and sqlsmith survived twenty minutes in #4, before the fallback and expression scanning changed.
  • James Colemansaw an earlier versionLLM analysis, 88% sureJames examined the fallback costing after #3, explaining in #7 that uniqueness assumes best-case resource usage while a single group would prevent incremental sort from being selected.
  • Tom Lanesaw an earlier versionLLM analysis, 98% sureTom rejected the extreme fallback estimates and recommended DEFAULT_NUM_DISTINCT in #17, which the committed revision adopted alongside a later change to expression scanning.

Credits across 2 commits

Author
Richard Guo1
Tomas VondraLLM1
Reviewer
Tomas Vondracommitter1
Reported by
Justin Pryzby1
Committer
Tomas Vondra2

N LLM means N of the credits come from LLM analysis, not from commit trailers.