opt: Poor row count estimate for join with multiple conditions #38735
Labels
A-sql-optimizer
SQL logical planning and optimizations.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
T-sql-queries
SQL Queries Team
Projects
Using the TPC-H schema, I was running a query similar to the following:
EXPECTED: I expected the estimated number of rows returned by the join to be in the same ballpark as the actual number of rows.
ACTUAL: The estimated number of rows was only 2,429, even though the actual number of rows is 6,001,215.
This discrepancy seems to occur only when both join conditions are used together. Either one alone gives 4+ orders of magnitude of difference, which is surprising.
Epic CRDB-16930
Jira issue: CRDB-5612
Jira issue: CRDB-13896
The text was updated successfully, but these errors were encountered: