Logical query-processing phases
Logical query-processing phases in brief


(1) FROM
This phase identifies the query’s source tables and processes table operators.
Each table operator applies a series of subphases.
For example, the phases involved in a join are
(1-J1) Cartesian Product, (1-J2) ON Predicate, (1-J3) Add Outer Rows.
This phase generates virtual table VT1.
(1-J1) Cartesian Product
This phase performs a Cartesian product (cross join)
between the two tables involved in the table operator, generating VT1-J1.
(1-J1) Cartesian Product This
This phase filters the rows from VT1-J1 based on the predicate
that appears in the ON clause (<on_predicate>).
Only rows for which the predicate evaluates to TRUE are inserted into VT1-J2.
(1-J3) Add Outer Rows
If OUTER JOIN is specified (as opposed to CROSS JOIN or INNER JOIN),
rows from the preserved table or tables for which a match was not found
are added to the rows from VT1-J2 as outer rows, generating VT1-J3.
(2) WHERE
This phase filters the rows from VT1 based on the predicate that appears in the WHERE clause (<where_predicate>).
Only rows for which the predicate evaluates to TRUE are inserted into VT2.
(3) GROUP BY
This phase arranges the rows from VT2 in groups based on the set of expressions
(aka, grouping set) specified in the GROUP BY clause, generating VT3. Ultimately,
there will be one result row per qualifying group.
(4) HAVING
This phase filters the groups from VT3 based on the predicate that
appears in the HAVING clause (<having_predicate>). Only groups for
which the predicate evaluates to TRUE are inserted into VT4.
(5) SELECT
This phase processes the elements in the SELECT clause, generating VT5.
(5-1) Evaluate Expressions
This phase evaluates the expressions in the SELECT list, generating VT5-1.
(5-2) DISTINCT
This phase removes duplicate rows from VT5-1, generating VT5-2.
(6) ORDER BY
This phase orders the rows from VT5-2 according to the list specified in the ORDER BY clause,
generating the cursor VC6. Absent an ORDER BY clause, VT5-2 becomes VT6.
(7) TOP | OFFSET-FETCH
This phase filters rows from VC6 or VT6 based on the top or offset-fetch specification,
generating VC7 or VT7, respectively. With TOP, this phase filters the specified
number of rows based on the ordering in the ORDER BY clause, or based on arbitrary order
if an ORDER BY clause is absent. With OFFSET-FETCH, this phase skips the specified number of rows,
and then filters the next specified number of rows, based on the ordering in the ORDER BY clause.
The OFFSET-FETCH filter was introduced in SQL Server 2012.
to be end
Logical query-processing phases的更多相关文章
- Inside TSQL Querying - Chapter 1. Logical Query Processing
Logical Query Processing Phases Summary (8) SELECT (9) DISTINCT (11) <TOP_specification> <s ...
- Sentry 监控 - Snuba 数据中台架构(Query Processing 简介)
系列 1 分钟快速使用 Docker 上手最新版 Sentry-CLI - 创建版本 快速使用 Docker 上手 Sentry-CLI - 30 秒上手 Source Maps Sentry For ...
- Inside TSQL Querying - Chapter 2. Physical Query Processing
Summary Description The SQL language is spoken by most database experts, and all relational database ...
- CMU Database Systems - Query Processing
Query Model Query处理有三种方式, 首先是Iterator model,这是最基本的model,又称为volcano,pipeline模式 他是top-down的模式,通过next函数 ...
- adaptive query processing
http://www.cs.umd.edu/~amol/talks/VLDB07-AQP-Tutorial.pdf https://www.cis.upenn.edu/~zives/research/ ...
- In-Stream Big Data Processing
http://highlyscalable.wordpress.com/2013/08/20/in-stream-big-data-processing/ Overview In recent y ...
- SQL optimizer -Query Optimizer Deep Dive
refer: http://sqlblog.com/blogs/paul_white/archive/2012/04/28/query-optimizer-deep-dive-part-1.aspx ...
- [转载]MongoDB学习 (五):查询操作符(Query Operators).1st
本文地址:http://www.cnblogs.com/egger/archive/2013/05/04/3059374.html 欢迎转载 ,请保留此链接๑•́ ₃•̀๑! 查询操作符(Quer ...
- Deploying Customizations in Oracle E-Business Suite Release 12.2
DeployingCustomizations in Oracle E-Business Suite Release 12.2 This documentdescribes how to deploy ...
- Microsoft SQL Server Trace Flags
Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...
随机推荐
- angular.extend用法实例
angular.extend:依次将第二个参数及后续的参数的第一层属性(不管是简单属性还是对象)拷贝赋给第一个参数的第一层属性,即如果是对象,则是引用的是同一个对象,并返回第一个参数对象. 实例一 ...
- python拆分CANLog
通过CANOE 导出的log通常有很多个ID的数据,如何才能找到某一个ID下的特殊的信号?利用python可以简单的进行这个步骤,代码如下: 说明: 最终的效果是将log信息,分不同的ID进行拆分,并 ...
- Android Studio插件:GsonFromat
这个Android Studio插件可以根据JSONObject格式的字符串,自动生成实体类参数. 具体见:https://github.com/zzz40500/GsonFormat
- Python复习之生成器 generator
生成器 generator def h(): print "hello" m = yield 5 print "m:", m d = yield 12 prin ...
- raspbian调整分辨率
参考 https://www.raspberrypi.org/documentation/configuration/config-txt.md 设置示例,设置成800*600 tvservice - ...
- Debian-based Linux distributions 安装 virtualbox
Add the following line to your /etc/apt/sources.list: deb http://download.virtualbox.org/virtualbox/ ...
- Reverse Core 第一部分 代码逆向技术基础
@date: 2016/10/14 <逆向工程核心原理>笔记 记录书中较重要的知识,方便回顾 ps. 因有一些逆向基础,所以我本来就比较熟悉的知识并未详细记录 第一章 关于逆向工程 目标, ...
- Android-RelativeLayout(相对布局)
1.RelativeLayout(相对布局) 2.margin针对的是容器中的组件,而padding针对的是组件中的元素
- UIStackView before iOS9.0
我用的Xcode8.1,同伴用的Xcode7.3.1,其上传了几个XIB文件,导致我这边项目一直爆红,爆红信息:"UIStackView before iOS9.0".如图: 网上 ...
- ASP.NET MVC 设置Area中 Controller 的方法 默认启动页
MVC中通常分区域编程,互不干扰,如果需要设置某个区域下面的某个控制器下面的某个方法为默认启动页的话,直接修改项目的路由如下: public static void RegisterRoutes(Ro ...