Home > Database > Mysql Tutorial > Introduction to logical query processing in mysql (code example)

Introduction to logical query processing in mysql (code example)

不言
Release: 2019-02-15 14:02:15
forward
1585 people have browsed it

This article brings you an introduction to logical query processing in mysql (code examples). It has certain reference value. Friends in need can refer to it. I hope it will be useful to you. helped.

Query processing can be divided into logical query processing and physical query processing.
Logical query processing indicates what results should be produced by executing the query.
Physical query processing indicates how the MySQL database obtains the result.
The two query methods may be completely different, but the results must be the same.

1. Logical query processing

In sql language, the first clause to be processed is always the FROM clause.

//示例
//前面的序号表示执行的顺序
(8) SELECT (9) DISTINCT<select_list>
(1) FROM<left_table>
(3) <join_type> JOIN <right_table>
(2)				ON<join_condition>
(4) WHERE <where_condition>
(5) GROUP BY<group_by_list>
(6) WITH {CUBE|ROLLUP}
(7) HAVING <having_condition>
(10) ORDER BY<order_by_list>
(11) LIMIT<limit_number>
Copy after login

You can see that FROM is executed first and LIMIT is executed last. Each operation produces a virtual table that serves as input to a process. These virtual tables are transparent to users, and only the virtual tables generated in the last step will be returned to users.

The above is the detailed content of Introduction to logical query processing in mysql (code example). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template