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的更多相关文章

  1. Inside TSQL Querying - Chapter 1. Logical Query Processing

    Logical Query Processing Phases Summary (8) SELECT (9) DISTINCT (11) <TOP_specification> <s ...

  2. Sentry 监控 - Snuba 数据中台架构(Query Processing 简介)

    系列 1 分钟快速使用 Docker 上手最新版 Sentry-CLI - 创建版本 快速使用 Docker 上手 Sentry-CLI - 30 秒上手 Source Maps Sentry For ...

  3. Inside TSQL Querying - Chapter 2. Physical Query Processing

    Summary Description The SQL language is spoken by most database experts, and all relational database ...

  4. CMU Database Systems - Query Processing

    Query Model Query处理有三种方式, 首先是Iterator model,这是最基本的model,又称为volcano,pipeline模式 他是top-down的模式,通过next函数 ...

  5. adaptive query processing

    http://www.cs.umd.edu/~amol/talks/VLDB07-AQP-Tutorial.pdf https://www.cis.upenn.edu/~zives/research/ ...

  6. In-Stream Big Data Processing

    http://highlyscalable.wordpress.com/2013/08/20/in-stream-big-data-processing/   Overview In recent y ...

  7. SQL optimizer -Query Optimizer Deep Dive

    refer: http://sqlblog.com/blogs/paul_white/archive/2012/04/28/query-optimizer-deep-dive-part-1.aspx  ...

  8. [转载]MongoDB学习 (五):查询操作符(Query Operators).1st

    本文地址:http://www.cnblogs.com/egger/archive/2013/05/04/3059374.html   欢迎转载 ,请保留此链接๑•́ ₃•̀๑! 查询操作符(Quer ...

  9. Deploying Customizations in Oracle E-Business Suite Release 12.2

    DeployingCustomizations in Oracle E-Business Suite Release 12.2 This documentdescribes how to deploy ...

  10. Microsoft SQL Server Trace Flags

    Complete list of Microsoft SQL Server trace flags (585 trace flags) REMEMBER: Be extremely careful w ...

随机推荐

  1. POJ1002

    转化为七位数字 #include<iostream> #include<map> #include<cstring> #include<cstdio> ...

  2. Intern---Microsoft Academic China Team

    项目二: AEther: 项目 一.项目需求:对搜索关键词进行类别的统计分析,为了后面的entity-rank做准备. 0,各种关键数据统计: 数据量:1个月数据:about 1000T. 1,对IE ...

  3. SWFUpload多图上传、C#后端跨域传文件带参数

    前几天工作中用到了SWFUpload上传图片,涉及到跨域,因为前端无法实现跨域,所以只能把文件传到后端进行跨域请求,整理分享下. 效果图 前端 html部分 <!DOCTYPE html> ...

  4. js调用php和php调用js的方法举例

    js调用php和php调用js的方法举例1 JS方式调用PHP文件并取得php中的值 举一个简单的例子来说明: 如在页面a.html中用下面这句调用: <script type="te ...

  5. json 构造和解析

    目录: (1)引入jar包: (2)json的构造: (3)json的解析: (4)遍历未知key. (1)java对json的处理,可借助org.json.jar. <!-- https:// ...

  6. .net测试学习--理解.net测试选项

    1.创建基于测试简单应用程序 (1)启动visual studio(有安装c#的) (2)  选择File|New project (3)创建一个C# project,名字和保存路径自己设定,假设取名 ...

  7. RIDE -- Robot Framework setup

    RobotFramework 是一款基于python 的可以实现关键字驱动和数据驱动并能够生成比较漂亮的测试报告的一款测试框架 这里使用的环境是 python-2.7.10.amd64.msi RID ...

  8. andriod刷机

    有句古话叫常在河边走,难免会翻船.对于经常刷机的Android刷友来说,难免会碰到刷机失败损坏recovery程序乃至手机无法启动的情况,也就是传说中的手机变砖块.不过刷机失败手机变砖并不是世界末日, ...

  9. ios获取设备信息总结

    1.获取设备的信息 UIDevice *device = [[UIDevice alloc] int]; NSString *name = device.name;       //获取设备所有者的名 ...

  10. 用极简方式实现新浪新版本特性展示效果--view的图片轮播

    在发布版本的时候,大多数软件会在第一次使用新版本时候弹出视图用几张图片给用户做一个新版本特性介绍,最简单如下图新浪的版本特性介绍 由于图片是全屏展示且是左右滑动,大多数情况开发者会选择使用scroll ...