Mysql performance optimization 2: mysql Performance Optimization
Next, Mysql performance optimization 1Create an appropriate index
To improve database performance, indexing is the best
High Performance MySQL Reading Notes (on), high performance mysqlHigh Performance MySQL is a classic book. From the application layer to the database to the hardware platform, all the tuning techniques and common problems are mentioned. Various concepts and techniques of the
Label:Such as:SELECT * from Table_1 left joins table_2 on table_1.id = table_2.t1_id and table_2.status > 0SELECT * from table_1 LEFT join table_2 on table_1.id = table_2.t1_id where table_2.status > 0Two queries were found to be different.Why there is a difference, which is related to the where query order.(1): On the following filter conditions are mainly related to the table "and for the primary table filter conditions do not apply."(2): The filter
Mysql performance optimization tool -- Introduction to tuner-primer and mysql Performance Optimization
Download and change the execution permission:Wget http://www.day32.com/MySQL/tuning-primer.shChmod + x tuning-primer.sh/Tuning-primer.shResult report:It will be marked with
index page each time the function is called, this is a very performance-consuming operation, and for many other relational databases it is using "histogram" statistics to avoid this operation ( I believe that the MARIADB subsequent version will also implement histogram statistics.2.3 Choice of order and access mode: Poor lift
MySQL finds the optimal execution order and access mode by enumerating all the l
, if a table is rarely changed, then the query based on the table can reuse the query cache results.? After the query is decomposed, executing a single query can reduce the competition for locks.The application layer makes it easier to split the database, making it easier to perform high-performance and scalable.The efficiency of the query itself may also be improved. In this example, using in () instead of an associative query allows
At the early stage of application system development, due to the relatively small amount of data in the development database, the performance of SQL statement writing is not good for Querying SQL statements and writing complex views, however, after the application system is submitted to the actual application, as the data in the database increases, the system response speed becomes one of the most important problems to be solved by the system. A heavy
Mysql optimization and mysql Performance Optimization
1. view the mysql server configuration information show variables. You can also use show variables like 'key % '. 2. view the status values of the mysql server running show status, which is the current session, if you qui
, the result is not dependent on the external query
DEPENDENT subquery: The first select in the inner layer of the subquery, dependent on the external query
The second select in the Union:union statement is followed by all the Select,
Simple
Combine results in Union result Union
Table
Show this step the table name in the database that you are accessing
Type
How to access a table
All:
SELECT
recordset. /path/mysqldumpslow-s t-t 10-g "left join"/database/mysql/slow-log to get the first 10 lines sorted by time, containing the query statement that contains the connection.Using the Mysqldumpslow command can be very clear to get a variety of query statements we need, the MySQL query statement monitoring, analysis, optimization is a very important step in
experience of database development. Although it is not limited to specific DBMS and hardware platforms, it is a very practical book.
1. Connect to the database at a time and do a lot of things. The connection is disconnected until the processing is complete.2. An SQL statement contains as many operations as possible. In the image, thousands of statements are cyclically slow with the help of cursors. It is slow to process the same data with several statements. Replace it with a statement to solv
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 associations between tables, data types for table fields, and so on. This requi
our application, by adding cheap PC Server servers, you can linearly increase the overall service capabilities of the Database Cluster, so that the database does not easily become the performance bottleneck of the application system.14.6 possible problems in data splitting and integration
Here, you should have a certain understanding of the implementation of data splitting and integration, perhaps many readers have chosen solutions suitable for their
association query, and there is no appropriate index, perhaps one of the sub-query created a temporary table, and then make a union query with other tables, and the temporary table used to hold the results of the subquery is not indexed.? Note, however, that using show status itself creates a temporary table and also accesses the temporary table through a handle operation, which also affects the show status corresponding number in the result, and the
processed much faster than text types. In this way, we can improve the performance of the database.2. Use connection (join) instead of subquery (sub-queries)MySQL supports SQL subquery starting from 4.1. This technique can use the SELECT statement to create a single-column
greatly reduce the amount of IO. 4. Try to use join instead of subquery While Join performance is poor, there is a significant performance advantage over MySQL subqueries. MySQL's sub-query execution plan has been a big problem,
. 2, use the connection (join) to replace the subquery (sub-queries) MySQL supports SQL subquery starting with 4.1. This technique can use a SELECT statement to create a single column of query results, and then use the result as a filter condition in another query. For example, to delete a customer with no orders in th
. In this way, we can improve the performance of the MySQL database.
2. Use JOIN instead of Sub-Queries. MySQL supports SQL subqueries starting from 4.1. This technique can use the SELECT statement to create a single column query result, and then use this result as a filter condition in another query. For example, if
performance.
2. use JOIN instead of Sub-Queries)
MySQL supports SQL subqueries from 4.1. This technique can use the SELECT statement to create a single column query result, and then use this result as a filter condition in another query. For example, if you want to delete a customer who has no orders in the basic customer information table, you can use the
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.