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. ES6学习笔记二

    字符串遍历 var str = 'hello'; for(let s of str){console.log(s += ' ')} //h e l l o 字符串查找:添加了include(str,i ...

  2. Apache 配置多站点访问「为项目分配二级域名」

    一级域名(baidu.com)也叫作顶级域名,注册一级域名是需要付费的. 而二级域名(image.baidu.com)是一级域名的延伸,所以只要购买了一级域名,二级域名是可以任意配置的. 其实(www ...

  3. Ubuntu14.04更新源、安装chrome/搜狗输入法

    目录: 1.更新源 2.安装chrome 3.安装搜狗输入法     1.更新源 三步: cp /etc/apt/sources.list /etc/apt/sources.list_backup   ...

  4. 后台访问 JS解决跨域问题

    今天看了看以前做的一个小项目(其实就是一个页面),分享一下当时解决跨域问题的: 背景:公司把项目部署在多台服务器上,防止一台服务器崩溃后,其他的可以继续访问,对应本公司来说,某台服务器出问题后,技术人 ...

  5. LruCache算法原理及实现

    LruCache算法原理及实现 LruCache算法原理 LRU为Least Recently Used的缩写,意思也就是近期最少使用算法.LruCache将LinkedHashMap的顺序设置为LR ...

  6. Linux 安装Mono环境 运行ASP.NET(二)

    一.安装libgdiplus     前面我们已经安装了apr.apr_util.pcre和httpd apache .现在我们来安装libgdiplus Libgdiplus是一个Mono库,用于对 ...

  7. SSM框架总结(1)

    ----------------------20170106-------------------------------------- 1.mabatis.genertor中自动生成文件,需要在ge ...

  8. JS多线程(web work)

    JS多线程JS多线程不允许操作DOM 1. 引用Concurrent Thread.js库用法:Concurrent.Thread.Create(function(){};) 2. Web Workh ...

  9. phpcms v9 中的数据库操作函数

    1.查询 $this->select($where = '', $data = '*', $limit = '', $order = '', $group = '', $key='')   返回 ...

  10. 与你相遇好幸运,使用redis设置定时任务

    参考链接: Nodejs中使用Redis来完成定时任务 自己在 window 7下编码实现: 1 > 首先查看redis版本: redis-server -v , 版本要求大于等于2.8 2&g ...