Order related issues between multiple leftjoins in MySql

Source: Internet
Author: User
[To] What is the order between multiple leftjoin statements in MySql? In MySql, the order between multiple leftjoin statements is as follows: three partition tables (block), post tables (post), and Member tables (user) if you want to query the section of the post in the post list and the member information of the post, the SQL statement is as follows :? Efficient statement: 1. SELECT * FROM

[To] What is the order between multiple left joins in MySql? Order between multiple left joins in MySql: Three table blocks, post, and user) if you want to query the section of the post in the post list and the member information of the post, the SQL statement is as follows :? Efficient statement: 1. SELECT * FROM

[Go] Order between multiple left joins in MySql

?

Order between multiple left joins in MySql

If you query the sections in the post list and the member information of the added posts, the SQL statement is as follows:

?

Efficient writing:

1. SELECT * FROM post left join block ON... left join user ON... WHERE... order by... LIMIT

? Low Efficiency:

2. SELECT * FROM post left join user ON... left join block ON... WHERE... order by... LIMIT ....

? There is a principle in order to optimize the connection conditions: the conditions for a small number of plays should be written in front.

The number of sections in a forum is smaller than the number of users.

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.