Home > Database > Mysql Tutorial > body text

using where and using index in explain in MySQL

little bottle
Release: 2019-04-18 15:48:51
forward
4861 people have browsed it

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!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template