How MySQL works from the left join to the join to the query plan to the Federated Index

Source: Internet
Author: User

Left Join

Left join in no brain use, will be large table drive small table, trigger Cartesian set, slow efficiency

Join will auto small table drive Large table

Reference:

Deepen your understanding of query plans from an example of MySQL left join optimization
http://luxuryzh.iteye.com/blog/1976004

Related explain query plan explanation

Type is divided into several categories, such as system/const/eq_ref/ref/range/index/all, the efficiency of the connection
Good.. "Poor

All: wood useful to index

Index, use the

Range, index between in etc Range class

Ref non-primary key index

Const PRIMARY KEY index

Reference:

MySQL Execution plan interpretation-Ggjucheng-Blog Park
Http://www.cnblogs.com/ggjucheng/archive/2012/11/11/2765237.html

The principle of federated indexing

Suppose A is 1,2,3,b and also a

Set A/b as a federated index

is sorted in the tree (A, B)

1 1, 1 2, 1 3,

2 1, 2 2, 2 3,

3 1, 3 2, 3 3

Just look at a, a is ordered, and B is not.

So in the query, if both are used in the where, then in no particular order, MySQL will automatically use the index,

If only a is used in the where, it is also possible because a has a sequential

If only B is used, the query plan has a type of all, that is, no index is used.

Reference:

MySQL InnoDB Federated Index Learning-ops that's something
http://www.ywnds.com/?p=11204

How MySQL works from the left join to the join to the query plan to the Federated Index

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.