I. Overview of optimizationThe MySQL database is a common two bottleneck that is CPU and I/O bottlenecks, when the CPU is saturated when the data is loaded into memory or read from disk. Disk I/O bottlenecks occur when the load data is much larger
slow query (slow log) can help us navigate to specific SQL statements for SQL statement-level optimizations, for example, the slow query log records those execution times that exceed a given SQL statement, thus locating the problem.Turn on Slow
An introduction
The principle of two indexes
Three-indexed data structures
Three MySQL index management
Four Test indexes
Five correct use index
Six query optimization artifact-explain
The basic steps of seven-slow query
Article turned from: http://www.ywnds.com/?p=3721MySQL various log file related variables introducedQuerying variables for all logs
1
MySQL> show global variables like '%log% ';
Global indicates the status
---restore content starts---1. Purpose of the database: Write data and read data2. The life cycle of the query statement:(1) MySQL server listening 3306 port (2) Authenticated access User (3) Create MySQL thread(4) Check memory (Qcache)(5) Parse SQL
In MySQL, there are 4 different logs, namely error log, binary log, query log, and slow query log.Error logThe error log records information about when MySQL starts and stops, and when a critical error occurs during the run of the server.To view the
Log files are very important for a server, it records the operation of the server information, many operations will be written to log files, through the log file can monitor the running state of the server and view the performance of the server, but
About MySQL TuningThere are 3 ways to speed up the running of the MySQL server, from low to high efficiency:Replace the problematic hardware.Tuning the MySQL process settings.Optimize the query.
Replacing the problematic hardware is usually our
In any database, there are a variety of logs. MySQL is no exception, there are 4 different logs, error logs, binary logs, query logs, and slow query logs in MySQL. These logs record the different aspects of the MySQL database. These 4 different log
1. Commands that show some parameters for slow queries: show variables like '%slow% '; results2. The above four parameters mean:Log_slow_queries off means "slow query" is "off state"Slow_launch_time 2 means "The query time is more than 2 seconds to
Summary of Mysql slow query operations and summary of mysql
Mysql slow query explanation
The slow query log of MySQL is a log record provided by MySQL. It is used to record the statements whose response time exceeds the threshold value in MySQL,
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,
Slowquerylog slow query statement bitsCN.com
Slow query log Slow query statement slow query log Slow query log. by setting related slow query parameters, you can output Slow SQL statements of the database to the log. this is the slow query log, in
If you are a web developer and want to debug your application or improve its performance, you need to refer to various log files. Logs are the best choice for troubleshooting. For the famous MySql database server, you need to refer to the following
Today, database operations are increasingly becoming the performance bottleneck of the entire application, especially for Web applications. Concerning the performance of the database, this is not just something that DBAs need to worry about, but it
This article mainly introduces the MySQL log file, this article explains the error log, binary log, General query log, slow query log, InnoDB online redo log, update log and other log types and role introduction, need friends can refer to the
View table-related commands- 查看表结构 desc 表名- 查看生成表的SQL show create table 表名- 查看索引 show index from 表名Using indexes and not using indexes由于索引是专门用于加速搜索而生,所以加上索引之后,查询效率会快到飞起来。# 有索引Mysql>Select* fromTb1whereName ='Zhangqiye';+-----+-------------+---
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.