Commit 8d08350
committed
MDEV-36321 keys generated on derived tables produce wrong out_rows estimates
record per key statistics on keys generated for derived tables are missing,
causing a fallback to the usage of MATCHING_ROWS_IN_OTHER_TABLE in
best_access_path().
This can grossly overestimate the number of rows expected during a join
and cause a bad join order. This patch tries to infer a few simple
things about the derived table, like when the key being created matches
the group by list inside (if any) inside the derived table.
Approved by Sergei Petrunia (sergey@mariadb.com)
Tested by Lena Startseva (lena.startseva@mariadb.com)1 parent 28f5322 commit 8d08350
File tree
13 files changed
+1114
-187
lines changed- mysql-test/main
- sql
13 files changed
+1114
-187
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4280 | 4280 | | |
4281 | 4281 | | |
4282 | 4282 | | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
4283 | 4286 | | |
4284 | 4287 | | |
4285 | 4288 | | |
| |||
0 commit comments