An index is a particular sort of algorithm for a particular MySQL field, such as a two-tree algorithm and a hashing algorithm, which is created by creating eigenvalues and then quickly finding them based on eigenvalues. And the most used, and is the
Mysql tuning three steps (slow query and explain profile) often encounter some SQL problems in performance tests. In fact, the most problems encountered in performance tests over the past few years are databases, either high I/O or high cpu, Data
MySQL index and optimization QueryAn appropriate index can accelerate the query speed. There are four types: primary key, unique index, full-text index, and common index.Primary Key: It is unique and has no null value.Create table pk_test (f1 int
Mysql optimization practice (explain & Index) and mysql practiceLab environment:
1. SQL tool: Navicat2 and SQL database. Use openstack database as an example.
I. mysql index Query
Show index from instances
Result field
Explain shows how MySQL uses indexes to process SELECT statements and join tables. Can help select better indexes and write more optimized query statements.Using the method, add explain to the SELECT statement:Such as:
Explain select
Turn on Slow queryFirst we check if the MySQL server's slow query status is turned on. Execute the following command:650) this.width=650; "Src=" http://images.cnitblog.com/blog/44702/201301/ 23175454-351c6f142b774ac9bbe923faf9482c85.jpg "style="
I have a table w1000, there are 10 million data, this table structure is as follows:CREATE TABLE ' w1000 ' (' ID ' varchar ($) Not NULL,' Name ' varchar () DEFAULT NULL,' Age ' int (3) DEFAULT NULL,' Money ' double (8,2) DEFAULT NULL,' Address '
Suddenly whim want to learn MySQL optimization, found a good introduction explain article, the promotion of hope for everyone to help:Article reprinted from: Http://database.51cto.com/art/200912/168453.htmExplain shows how MySQL uses indexes to
Here we will introduce the MySQL in the explain interpretation of the order, I hope to help you.AD:Explain shows how MySQL uses indexes to process SELECT statements and join tables. Can help select better indexes and write more optimized query
http://258xiaolei-sina-com.iteye.com/blog/764665Start MySQL with parameter--log-slow-queries to record SQL execution time of more than long_query_time secondsMySQL comes with slow log analysis tool Mysqldumpslow.Slow log is a file written by MySQL
Description of the EXPLAIN column:Table: displays the data of this row about which tableType: this is an important column that shows the type used by the connection. The connection types from the best to the worst are const, eq_reg, ref, range,
You can add the explain statement before the select statement:Example: explain select * from test1Description of the EXPLAIN column:Table: displays the data of this row about which tableType: this is an important column that shows the type used by
I. Cross join)
Cross join: there are two types: explicit and implicit, without the on clause. The returned result is the product of the two tables, also called Cartesian product.
For example, the following statements 1 and 2 have the same
Explain shows how MySQL uses indexes to process select statements and connect tables. It can help you select better indexes and write more optimized query statements.You can add the explain statement before the SELECT statement:Example: Explain
Informix IDS databases are widely used in various industries such as finance, telecommunications, and postal services. It is a multi-threaded relational database server that adopts symmetric multi-processor technology and single-processor
Show ProcesslistShow Processlist shows which threads are running. You can also use the Mysqladmin processlist statement to get this information.The meaning and purpose of each column:ID columnAn identity that is useful when you want to kill a
Introduction to MYSQLexplain
Explain shows how mysql uses indexes to process select statements and connect tables. it can help select better indexes and write more optimized query statements.Usage: add explain before the select statement. for
I. cross join)
Cross join: there are two types: explicit and implicit, without the on clause. The returned result is the product of the two tables, also called Cartesian product.
For example, the following statements 1 and 2 have the same
One, using the MySQL slow query log location to execute inefficient SQL statements.When MySQL uses the slow query log to locate those SQL statements that perform less efficiently, and start with the--log-slow-queries[=file_name] option, Mysqld
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.