MySQL's "slow query" refers to an SQL statement that exceeds the maximum allowable query time ( long_query_time ), and the "unused index" query, by definition, is the SQL statement that the query statement does not use to the index.Slow query
Index is the most important tool for improving the query speed. Of course there are other technologies available for use, but in general, the biggest performance difference is the correct use of indexes. In the MySQL Mail List, people often ask for
One, what is the index
One of the best ways to reduce disk I/O and logical read times is to use the index
The index allows SQL Server to look up data in a table without having to scan the entire table.
1.1, the advantages of the index:
Become a
Mysql uses indexes for query optimization and mysql index Query Optimization
The purpose of indexing is to improve the query efficiency. It can be analogous to a dictionary. If you want to query the word "mysql", you must locate the m letter and
View table-related commands- 查看表结构 desc 表名- 查看生成表的SQL show create table 表名- 查看索引 show index from 表名Using indexes and not using indexes由于索引是专门用于加速搜索而生,所以加上索引之后,查询效率会快到飞起来。# 有索引Mysql>Select* fromTb1whereName ='Zhangqiye';+-----+-------------+---
This article "My MySQL Learning experience (15)" will explain the MySQL logThe logs in MySQL are divided into 4 categories, and using these log files, you can see what's happening inside MySQL.respectively is1, error log: Log the MySQL service start,
The following articles mainly describe the creation and deletion of MySQL databases, as well as the detailed parsing of indexes and changing actual table statements. If you are also popular with MySQL databases, you can click the following article
Log file type
MySQL has several different log files that can help you find out what's going on inside Mysqld:
Log files
Type of information entered in a file
Error log
Log a problem that occurs when you start, run,
1. Redundant and duplicate indexesMySQL allows multiple indexes to be created on the same column, either intentionally or unintentionally, andMySQL needs to maintain duplicate indexes separately, and the optimizer needs to consider each one
Poor SQL statements often come from inappropriate index design, incomplete join conditions, and unoptimizable where clauses. InAfter they are properly optimized, their running speed is significantly improved! I will summarize the following three
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.