Home  >  Article  >  Database  >  using where and using index in explain in MySQL

using where and using index in explain in MySQL

little bottle
little bottleforward
2019-04-18 15:48:514845browse

The main content of this article is about the use of using where and using index in mysql database explain. Interested friends can learn more.

1. View all indexes in the table show index from modify_passwd_log; There are two primary key indexes, one is id, and the other is a normal index for email_id

2. Using index means that the index is used, and the retrieved data can be obtained completely in the index.

explain select email_id from modify_passwd_log where email_id=670602;

3. type is ref, where is blank: the index is used, but the queried data is not in the index, go back to the table to get the data

explain select * from modify_passwd_log where email_id=670602;

4. type is ref, where is using where, which means the index is used, but where filtering is also performed

Recommended courses: mysql video tutorial

The above is the detailed content of using where and using index in explain in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete