MySQL - 'Using the index condition' vs' Using where; Using the index '

I want to know the difference between “Using the index condition” and “Using where; Using the index '. I think that both methods use the index to select the recordset of the first result and the filter with the WHERE clause.

Q1. Who cares?

Q2. What's better?

Thanks.

+6
source share
1 answer

Using an index condition : provided that the condition contains an indexed and non-indexed column, and the optimizer first resolves the indexed column and searches for rows in the table for another condition (pressing the index)

Use where; Index Usage : “Index Usage” means not scanning the entire table. Using Where can still scan the table in an unindexed column, but it will be used if there is any indexed column in the index where the condition is more like using the index condition

What's better? 'Use where; Using an index 'would be better than using an index condition if the query has an index of the entire coverage.

+3
source

Source: https://habr.com/ru/post/983087/


All Articles