SQL tuning is primarily about reducing the number of consistent gets and physical reads.
COUNT (1) is compared with COUNT (*):
If your datasheet does not have a primary key, then count (1) is faster than COUNT (*)If you have a primary key, the
MySQL Query performance optimizationThe optimization of MySQL query performance involves many aspects, including library table structure, establishing reasonable index and reasonable query. The library table structure includes how to design
This article describes how to query logs and slow query logs in MySQL. It also describes how to use the Mysqldumpslow log analysis tool that comes with MySQL. For more information, see
I. query logs
Query all the queries in MySQL by using "-- log [=
Tested under MySQL 5.6.MyISAM Engine:When creating a data table, MySQL generates 3 files, respectively (table: Test):TEST.FRM, Test. MYD, Test. Myi file,TEST.FRM is the table structure, Test.myd is the file that holds the data, Test.myi is the file
A basic tutorial on querying logs and slow query logs in MySQL,
I. query logs
Query all the queries in MySQL by using "-- log [= file_name. Because all the queries, including all the select statements, are recorded, and the size is relatively large,
MySQL Slow Query Log (Slow Query Log), mysqlslow
Like most relational databases, log files are an important part of MySQL databases. MySQL has several different log files, such as error log files, binary logs, common logs, and slow query logs. These
This article is "high-performance MySQL" Reading notes
Slow Query Basics: Optimizing data accessThe most basic reason for poor query performance is that there is too much data to access. For inefficient queries, we found that the following two
I. User table information
Ii. Conclusion
Use the query statement: Select count (1) from user; Use the explain statement to check whether the statement is indexed. the following result shows the query time of the statement.
Data Volume query
Essays-66 Articles-0 comments-MySQL slow query (ii)-Pt-query-digest detailed slow query log one, Introduction Pt-query-digest is a tool for analyzing MySQL slow query, it can analyze Binlog, Gene RAL Log, Slowlog, can also be analyzed via
A common query in SQL queries should be a count operation. There is not much to say about queries with a where clause. If there is an index, an index will be used, and no index will be available.Simple count queries without where clauses are
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.