Commit a97a3ff
Fix guess_rec_per_key to not calculate negative values
Summary:
The function `guess_rec_per_key` tries to interpolate index cardinality by multiplying by (current keypart number) / (total keyparts). However, the denominator uses `key->user_defined_key_parts` which does not include extended key parts, while the current keypart being passed could be referencing extended keyparts. This means that the multiplicative factor could be > 1 which breaks some assumptions in this function.
This bug mainly affects myrocks, since innodb never needs to guess `rec_per_key` as it is always populated in `::info`.
Reviewed By: luqun
Differential Revision: D43013207
fbshipit-source-id: 9060eaa1 parent e428b37 commit a97a3ff
1 file changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
0 commit comments