MySQL performance tuning and Architecture Design-the idea and solution of the High Availability design in Chapter 17th, mysql Tuning
Chapter 1 High Availability design ideas and solutions
Preface:
The database system is the core part of an application system. To ensure the overall availability of the system, the database system cannot have any problems. For an en
Talking about MySQL temporary table and derived table, talking about mysql Derivation
About derived tables
When the primary query contains a derived table, or when the select statement contains the union clause, or when the select statement contains the order by clause of a
the height of the pure limit 159000,100.
But again, the subquery has to be data continuous, so the where query condition cannot be added, such as:
SELECT tid,pid,author,hash,dateline FROM posts WHERE tid=10 AND pid>=(SELECT pid FROM posts LIMIT 159000,1)ORDER BY pid ASC LIMIT 100;
The result is not the result I want at this time.
Therefore, the method of solving the limit paging by high performance is obtained. Online and so on.
=====================
problem of excessive Limit offset, you can use the subquery Method for paging. For example:
SELECT pid,author,hash,dateline FROM posts ORDER BY pid ASC LIMIT 159000,100;
It is equivalent:
SELECT pid,author,hash,dateline FROM posts WHERE pid>=(SELECT pid FROM posts LIMIT 159000,1)ORDER BY pid ASC LIMIT 100;
At this time, the performance is several times higher than that of pure LIMIT 159000,100.
However, the problem arises again, and the subquery must
High-Performance MySql evolution (11): Optimization of common query statements bitsCN.com
Summarize the optimization methods of common query statements.1 COUNT
1. Functions of COUNT
· COUNT (table. filed) indicates the number of records for which this field is not null.
· COUNT (*) or COUNT (not nullable field) indicates the number of rows in the entire
Detailed analysis of Table Partitioning technology in MySQL and table parsing in mysql
MySQL Partitioning technology (mysql 5.1 is used after version-> it is the technology that the maintenance personnel of the Oracle
situations require concrete analysis.
If the key_reads is too big, then should my.cnf in the key_buffer_size, keep key_reads/key_read_requests at least 1/100, the smaller the better.
Recommendations for improving performance
1. If the opened_tables is too large, the table_cache in the my.cnf should be bigger.2. If the key_reads is too large, the my.cnf key_buffer_size should be larger. Can calculate the cache failure rate with key_reads/key_read_r
table etc_passwd (pwd_entry TEXT );Mysql> load data infile '/etc/passwd' into table etc_passwd;Mysql> SELECT * FROM etc_passwd;If the access permission on the data directory of the MySQL server is not properly set, the security vulnerability that allows users with FILE perm
immediately after execution, and then the data is written to the hard disk when it is idle. More appropriate for logging.Straight_join: Defines the association order.Sql_small_result,sql_big_result: For querying, the size of the flag result set, the boot sort operation in memory or hard disk execution.Sql_buffer_result: Put the result of the query into a temporary table and release the table lock as soon a
like 'max _ connections ';+ ------ + --- +| Variable_name | Value |+ ------ + --- +| Max_connections | 256 |+ ------ + --- +The maximum number of connections on this MySQL server is 256, and then query the maximum number of connections on the server response:Mysql> show global status like 'max _ used_connections ';In the past, the maximum number of connections on the MySQL server was 245, but the maximum n
Note the point:(1) The total table name for the split is different, so create a temporary table, and the data for the gross position table is inserted into the temporary table first(2) In order to avoid the end of the outermost cursor polling data, throw not found exit the program, do not perform subsequent operations
engine federated to solve. The Federated storage Engine is a solution for MySQL to address issues like Oracle's DB Link. The main difference from Oracle DB Link is that federated saves a copy of the remote table structure's definition information locally. At first glance, Federated is really a great solution for cross-node joins. But we should also be clear, it seems that if the remote
performance problems
If there is a performance problem, you can analyze it:
1. is there any SQL statement stuck?
This is often the case. if myisam is used in the database, a write thread may lock the data table. if this statement does not end, other statements cannot be run.
Check the time item in processlist to see if the statements have been executed f
Topic: This is something that was recently recorded in high-performance MySqL version 2 ~
# Read locks (shared locks) and write locks (exclusive locks): Read locks are shared and are not blocked. Reading the same resource does not affect each other. Write locks are exclusive. A write locks block other read/write operations.
# Granularity of locked objects: Table
optimization includes:
Operating system installation optimization
System initialization
Process optimization
Memory optimization
IO optimization
File system optimization
Network adjustment
......
Let's take a look at a picture to help us understand it more intuitively, such:
3. Finally, we will talk about application optimization. here we will talk about the MySQL optimization example to give you a more intuitive u
We will first discuss the index, because it is the most important tool to speed up the query. Of course there are other technologies to speed up the query, but the most effective is to use the index properly. Next we will introduce what the index is, how it improves the query performance, and when the index may degrade as a free and efficient Database. mysql is the first choice. Good secure connection, buil
MySQL Performance Optimization MySQL supports five different table types, which may be unusual. These five types are BDB, HEAP, ISAM, MERGE, and MyISAM. Among them, the BDB type belongs to one category separately, which is called "transaction-safe", and the other table types
supported, but the indexes are read-only.MySQL built-in other storage engine
Archive: Suitable for high speed insertion , quick insert.
blackhole: There is no storage mechanism, he discards all inserted data, but the server logs the table log, so it can be used to copy the data to the repository, or simply to log.
CSV: You can process a normal CSV file as a MySQL
[SQL] MySQL Performance Optimization bitsCN.com
[SQL] MySQL Performance Optimization
1. optimize your query for the query cache
Query cache is enabled on most MySQL servers. This is one of the most effective ways to improve performance
does not support hash indexes, you can simulate the creation of hash indexes like InnoDB, which can be facilitated by the use of a few hash indexes, such as the ability to create indexes for extra-long keys with only a small index. 3. Spatial Data Index (R-Tree) The MyISAM table supports spatial indexes and can be used as a geographic data store. 4. Full-Text Indexing A full-text index is a special type of index that looks for keywords in text inste
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.