Mysql-select Statement Execution procedure

Source: Internet
Author: User

Select Execution Process

(8)Select (9) distinct <select list>
(1) from <left table>
(3) <join type> join <right table
(2) on <join condiction>
(4)where<>
(5)Group by <>
(6) with{cube| ROLLUP}
(7) having (ten)orderby <order by list>
(one)limit<limit list>

    1. Form : Calculates the Cartesian product for the table to the left of the From and the table on the right. Generates a virtual table VT1
    2. on : VT1 The virtual table is on, only those rows that conform to <join-condition> are recorded in the virtual table VT2.
    3. Join : If a outer join is specified (such as a LEFT JOIN or right join), rows that are not matched in the reserved table are added as outer rows to the virtual table VT2, resulting in a virtual table VT3, rug If you have more than two tables in the FROM clause, you will repeat the steps for the result VT3 and the next table for the previous join join three steps until all the tables have been processed.
    4. where : where conditional filtering is performed on the virtual table VT3. Only records that match <where-condition> will be inserted into the virtual table VT4.
    5. GROUP by : Groups the records in VT4 according to the columns in the GROUP BY clause, producing VT5.
    6. with CUBE | ROLLUP : VT5 The table with a cube or ROLLUP operation, resulting in a table VT6.
    7. Having : Applies a have filter to the virtual table VT6, only records that match
    8. Select : Performs a select operation, selects the specified column, and inserts it into the virtual table VT8.
    9. DISTINCT : de-weight the records in VT8. Generates virtual table VT9.
    10. ORDER by : Sorts the records in the virtual table VT9 by <order_by_list> to produce the virtual table VT10.
    11. LIMIT : Takes a record of the specified row, generates a virtual table VT11, and returns the result.

Insert Execution procedure

Mysql-select Statement Execution procedure

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.