opt: make stats consistent between lookup join and hash join #56441
Labels
A-sql-optimizer
SQL logical planning and optimizations.
A-sql-table-stats
Table statistics (and their automatic refresh).
C-cleanup
Tech debt, refactors, loose ends, etc. Solution not expected to significantly change behavior.
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
T-sql-queries
SQL Queries Team
The
statisticsBuilder
often does a poor job of estimating the statistics of lookup joins, resulting in a different estimate for a lookup join and equivalent hash join. We have so far been avoiding the potential problems caused by this by ensuring that the lookup join is added to the same memo group as the original join, so that it gets the same statistics. However, if we need to wrap the lookup join with aProject
operator, it ends up getting different statistics. This has turned out to be a problem in #56393, where we must wrap anti and semi paired-joins with aProject
operator.Epic CRDB-16930
Jira issue: CRDB-2941
Jira issue: CRDB-13903
The text was updated successfully, but these errors were encountered: