[MDEV-6904] index_merge intersect(index_that_covers_all_columns, index_that_covers_some) Created: 2014-10-21 Updated: 2018-01-16 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 5.5.39 |
| Fix Version/s: | 10.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | index_merge, optimizer | ||
| Issue Links: |
|
||||||||
| Description |
|
From jkavalik on #maria: index_merge/intersection plan is generated even when one index covers all columns:
|
| Comments |
| Comment by Sergei Petrunia [ 2014-10-21 ] | |||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||
| Comment by Brad Jorgensen [ 2016-07-05 ] | |||||||||||||||||||||||||||||||||
|
I have this same problem in 10.1.11. This is a sample I have handy, but the same thing happens with more complex queries selecting more columns and filtering on other columns, too.
Both columns are `INT`s. The `company_id` index is on `company_id` and the `acct_company` index is on `acctID, company_id`. According to `mysql.innodb_index_stats`, the estimated cardinalities are 1527 for the `company_id` index and 350, 2320 for the `acct_company` index with approximately 25 million rows in the table. Here are a few more EXPLAIN results that might also help.
|