[MDEV-5984] EITS: Incorrect filtered% value for single-table select with range access Created: 2014-03-31 Updated: 2014-04-02 Resolved: 2014-04-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.9 |
| Fix Version/s: | 10.0.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | eits | ||
| Description |
|
filtered% value is incorrect for single-table select and two-keypart key.
Then, try this:
The entire WHERE clause is used to construct range access. If we use range access, it will give us 9 rows, and after that 'filtered' should be 100%. Instead, it is 3.37%, and again the optimizer will grossly underestimate #rows. |
| Comments |
| Comment by Sergei Petrunia [ 2014-03-31 ] |
|
Analysis == calculate_cond_selectivity_for_table() == records_in_column_ranges() is invoked for b. We also see a quick select with used_key_parts=2 and We multiply these two selectivities (this is wrong) and get: = table_cond_selectivity() == |
| Comment by Sergei Petrunia [ 2014-03-31 ] |
|
Committed a patch. |