当前位置:网站首页>MySQL statement execution order
MySQL statement execution order
2022-07-22 18:50:00 【aabond】
Reprinted from :http://www.cnblogs.com/rollenholt/p/3776923.html
MySQL The statements are divided into 11 Step , As shown in the figure below , The first thing to do is always FROM operation , The last thing to do is LIMIT operation . Each of these operations produces a virtual table , This virtual table serves as a processing input , Only these virtual tables are transparent to users , But only the last virtual table will be returned as a result . If you don't specify a clause in the statement , Then the corresponding steps will be skipped .
Let's analyze each stage of query processing in detail
- FORM: Yes FROM The table on the left and the table on the right calculate Cartesian product . Produce a virtual table VT1
- ON: Antithetical table VT1 Conduct ON Screening , Only those matching rows will be recorded in the virtual table VT2 in .
- JOIN: If you specify OUTER JOIN( such as left join、 right join), The unmatched rows in the reserved table will be added to the virtual table as external rows VT2 in , Generate virtual tables VT3, If from Clause contains more than two tables , Then it will be for the last join The result of the connection VT3 Repeat steps with the next table 1~3 These three steps , Until all the watches have been processed .
- WHERE: For virtual tables VT3 Conduct WHERE filter . Only matching records will be inserted into the virtual table VT4 in .
- GROUP BY: according to group by Column in clause , Yes VT4 Group the records in , produce VT5.
- CUBE | ROLLUP: Counter table VT5 Conduct cube perhaps rollup operation , Generating table VT6.
- HAVING: For virtual tables VT6 application having Filter , Only records that match will be Insert into virtual table VT7 in .
- SELECT: perform select operation , Select the specified column , Insert into virtual table VT8 in .
- DISTINCT: Yes VT8 The records in are de duplicated . Generate virtual tables VT9.
- ORDER BY: Put the virtual table VT9 According to the records in <order_by_list> Sort operations , Generate virtual tables VT10.
- LIMIT: Take out the record of the specified line , Generate virtual tables VT11, And return the result .
边栏推荐
- App mobile End test [6] application (APK) package Management and Activity
- 各种资料汇总-网络
- PAT乙级1019 数字黑洞 (20 分) (测点错误可能原因)
- Summary 20220213 (Floyd and Dijkstra)
- The routing interface of local access to local TP5 of wechat applet is normal. Why can't you scan the code on the mobile phone to preview and get data?
- Log4J日志配置详解
- No input file specified solution
- 总结20220118(二叉树)
- 03.单一职责原则(Simple Responsibility Pinciple)
- Leetcode 653. sum of two IV - input BST
猜你喜欢
MySQL的语句执行顺序
[SDIO] sd2.0 protocol analysis summary (II) -- SD card identification & data transmission process
[Nordic] nrf52810 OTA upgrade (II) – how to use DFU
[SDIO] sd2.0 protocol analysis summary (I) -- Introduction to SD card basic probability
PTA基础题 7-23 币值转换 (20 分) (属实恶心)
连接mysql8.0出现caching-sha2-password问题
[STM32] STM32 SDIO SD card read / write test (II) -- SD_ Power on phase of init
Leetcode 114. expand binary tree into linked list
Simple demonstration and prevention of CSRF attack in PHP development
IP, subnet mask, gateway, IPS and IDS
随机推荐
LeetCode: 620. 有趣的电影
PAT乙级1020月饼(注意测点)
1.雷点:mysql数据库转移到oracle,2.qt5.12.3 连接oracle 12c数据库
1.通过类似window路径的方式访问json
Add the GD Library under centos7.5, and then the MySQL expansion library. There is no problem without the configuration of MySQL expansion. There is no MySQL expansion in phpinfo
Go 语言学习:Go 语言之旅(三)
[STM32] STM32 SDIO SD card read / write test (I) -- SD card hardware design and software migration
TCP and UDP, three handshakes and four waves
【QT源代码复用】QDateTimeEdit的下拉按钮事件响应
App移动端测试【6】应用程序(apk)包管理与activity
05. Law of Demeter LOD
[STM32] STM32 SDIO SD card read / write test (III) -- SD_ Init card stage of init
(c语言)数组是一种特殊的指针?
PAT乙级1019 数字黑洞 (20 分) (测点错误可能原因)
LeetCode: 1179. 重新格式化部门表
预算dll要达到的效果,Qt将第三方窗口嵌入程序内,excel操作,数据库外键,判断程序是否启动
Recursively find the partial sum of simple alternating power series (15 points)
QT的sprintf重写;qt下内容按界面的缩放而缩放(不改变字体大小)
LeetCode 720. 词典中最长的单词
Method of getting node binding data data index by applet