[MDEV-553] Excessive "Using where" when using varchar/char type index Created: 2012-09-26 Updated: 2014-06-06 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.27, 5.3.8, 5.2.12, 5.1.62 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Xiaobin Lin (Inactive) | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
all |
||
| Description |
|
When using varchar/char type of index , there is excessive "Using where" in the result of explain command. test case:
The result is the same after changing field "title" into binary
|
| Comments |
| Comment by Xiaobin Lin (Inactive) [ 2012-09-26 ] |
|
In the function test_if_ref , the string type can not call store_val_in_field because of the logic : if (field->binary() && So return 0, means the right_item is not removable. This will lead to the afterward logic decides that checking the value is necessary, and then call add_found_match_trig_cond tab->select->cond leads there is "Using where" shown in the result of explain and excessive comparison is later. Perhaps we can simply remove the strint type in the above logic : if (field->type() != MYSQL_TYPE_FLOAT || field->decimals() == 0) { return !store_val_in_field(field, right_item, CHECK_FIELD_WARN); } |