Reprint Please specify: theviper http://www.cnblogs.com/TheViperThis article next MySQL query statement optimization
Did you request data that you don't want?
Typical case: Querying for unwanted records, returning all columns when
13.1 System Variables-server configuration variablesMySQL displays many system variables through the show VARIABLES SQL command.13.2 State Variable--show statusThe Show status command displays the server state variables in a table of two columns
The default configuration for MySQL is not available for use in a large number of resources because of its high versatility.Do not expect to change the configuration file will bring huge performance gains. The size of the lift depends on the
Many high-performance sites use the "explode-connect" technique, which is to change a single multi-table connection query to multiple but table queries, and then merge the data into the program, such as:Select A.*,b.* from a a joins b b on a.id =
Test, textSlow query log open slow query log
Slow query logs, as the name implies, are logs that record slow query execution.
Check whether the slow query log is Enabled:
show variables like '%slow%';
Open the slow query log. The configuration file
Only good library table structure, reasonable index is not enough, we also need reasonable design inquiries, goes hand in hand, a lot of can give full play to the advantages of MySQL.
Why is the query slow?
Each query consists of a series of
When MySQL encounters high concurrency, it may encounter bottlenecks that have never been encountered.
First, InnoDB concurrent configuration
InnoDB is designed for high performance, and in recent years his ascension is obvious, but still
A character set is a mapping from binary encoding to a type of character symbol, and can refer to how to use a byte to represent English.
Proofing refers to a set of collations that are used for a character set.Each type of encoded character has
I. MySQL logical architecture
Second, the lock
1. Read and Write lock
Read locks are shared, are not blocking each other, multiple customers at the same time reading the same resources, complementary interference. Write locks are exclusive,
Here goes the optimizer section in the previous article:
How MySQL executes associated queries
MySQL performs nested loops associated operations on any association, that is, to loop out a single piece of data in a table, and then to nest loops
Hash index is implemented based on hash table, only queries that accurately match all the columns of the index are valid, and for each row of data, the storage engine computes a hash code for all the indexed columns, and the hash codes for the
First, the Basic principles
1, smaller is usually better
Smaller data types are usually faster because they take up less disk, memory, and CPU cache and require less CPU cycles to process.
But make sure that you don't underestimate the range of
One, covering index
Indexing is an efficient way to find data, but MySQL can also use indexes to get data directly from columns so that you no longer need to read rows of data. If the leaf node of the index already contains the data to query, what
Btree:1. Try to use the overlay index, which is Samsung index 2. Multi-column indexes if you have a range, subsequent columns are not filtered to 3. Multi-column indexes should be selected for better filtering to serve as prefix index 4. Try to
1. Connecting and Managing SecurityWhen the client side connects to the MySQL server, it will have a thread on the server side, and the connected query will be executed in this separate thread. The server is responsible for caching threads, so there
Reprint Please specify: theviper http://www.cnblogs.com/TheViper> This book is really very good, but unfortunately this cock, most of them do not understand, for the moment, write down the MySQL optimization related to their own useful things.Test
Description: This is an article about mysql performance, mysql performance optimization, and mysql performance optimization. There are many mysql performance optimization solutions on the Internet. However, mysql optimization is more troublesome and
Mysql High Performance Learning notes-02 Mysql High Performance Learning Notes 2
Liu Yan
Suhuanzheng7784877@163.com
Blog: suhuanzheng7784877.iteye.com
1. Preface
In high-performance Mysql, Chapter 2-benchmark test and Chapter 3-server performance
In high-performance mysql, we can see one sentence: & quot; each client connection will have a thread in the server process, and the query of this connection will only be executed in this separate thread, this thread can only run in a cpu core or
[Slow query optimization] use MySQL subqueries with caution, especially when you see the DEPENDENTSUBQUERY tag. The case sorting time is as follows: I have repeatedly stressed the importance of explain in slow query optimization 1 and 2, but
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.