本文翻译自Coding-Geek文章:《 How does a relational database work》。原文链接:http://coding-geek.com/how-databases-work/#Buffer-Replacement_strategies

本文翻译了如下章节, 介绍数据库的客户端管理器组件:

Query manager-数据库查询器





本章描述的查询器是数据库强大能力的核心所在。通过查询器,所有的查询SQL语句将被转换为能快速执行的代码。代码执行后,执行结果将返回给客户端管理器。整个过程分为几步:

1. 解析SQL语句并检查它是否合法。

2. 然后改写SQL语句,移除多余无用的操作,并添加一些前置的优化动作。

3. 进一步优化SQL语句以提升查询性能,再转换为一组可执行命令和数据访问规划。

4. 然后编译SQL语句。

5. 最后,执行SQL查询。

在本章,我不会重点描述后面的两点,这两点不是很重要,也非关键所在。读完本章节,如果你想了解得更深入一点,可以读一下这些文献:

1. The initial research paper (1979) on cost based optimization: Access Path Selection in a Relational Database Management System. This article is only 12 pages and understandable with an average level in computer science.

2. A very good and in-depth presentation on how DB2 9.X optimizes queries here

3. A very good presentation on how PostgreSQL optimizes queries here. It’s the most accessible document since it’s more a presentation on “let’s see what query plans PostgreSQL gives in these situations“ than a “let’s see the algorithms used by PostgreSQL”.

4. The official SQLite documentation about optimization. It’s “easy” to read because SQLite uses simple rules. Moreover, it’s the only official documentation that really explains how it works.

5. A good presentation on how SQL Server 2005 optimizes queries here

6. A white paper about optimization in Oracle 12c here

7. 2 theoretical courses on query optimization from the authors of the book “DATABASE SYSTEM CONCEPTS” here and there. A good read that focuses on disk I/O cost but a good level in CS is required.

8. Another theoretical course that I find more accessible but that only focuses on join operators and disk I/O.

本文为博主原创文章,未经博主允许不得转载。其它文章请访问:http://blog.csdn.net/ylforever

关系型数据库工作原理-数据库查询器(翻译自Coding-Geek文章)的更多相关文章

  1. 关系型数据库工作原理-事务管理(一)(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>. 原文链接:http://coding-geek.com/how-dat ...

  2. 关系型数据库工作原理-事务管理(二)(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>. 原文链接:http://coding-geek.com/how-dat ...

  3. 关系型数据库工作原理-查询优化器之索引(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>.原文链接:http://coding-geek.com/how-data ...

  4. 关系型数据库工作原理-数据特征统计分析(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>.原文链接:http://coding-geek.com/how-data ...

  5. 关系型数据库工作原理-数据库整体框架(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>.原文链接:http://coding-geek.com/how-data ...

  6. 关系型数据库工作原理-高速缓存(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>. 原文链接:http://coding-geek.com/how-dat ...

  7. 关系型数据库工作原理-快速缓存(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>. 原文链接:http://coding-geek.com/how-dat ...

  8. 关系型数据库工作原理-时间复杂度(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>. 原文链接:http://coding-geek.com/how-dat ...

  9. 关系型数据库工作原理-归并排序(翻译自Coding-Geek文章)

    本文翻译自Coding-Geek文章:< How does a relational database work>. 原文链接:http://coding-geek.com/how-dat ...

随机推荐

  1. Docker镜像的构成__Dockerfile

    相比docker commit来说,Dockerfile的方法会更加自动化,更加方便快捷,而且功能也更强大.拿构建Nginx容器举例. 先创建一个目录 mkdir /opt/docker-file 进 ...

  2. Windows API Finishing

    input { font-size: 14px; height: 26px } td { border-style: none; border-color: inherit; border-width ...

  3. Java遍历文件目录

    函数介绍 File[] listFiles():返回当前文件的子目录或子文件的文件数组. 遍历目录 调用listFiles()即可得文件的子目录和子文件,如果存在子目录,那么子目录需要再次调用list ...

  4. hdu 2045 递推

    从n>=4开始考虑,只考虑n-1和1的颜色是否相等情况.推出公式F(n)=F(n-1)+2*F(n-2) AC代码: #include<cstdio> const int maxn= ...

  5. Spring Data JPA 入门Demo

    什么是JPA呢? 其实JPA可以说是一种规范,是java5.0之后提出来的用于持久化的一套规范:它不是任何一种ORM框架,在我看来,是现有ORM框架在这个规范下去实现持久层. 它的出现是为了简化现有的 ...

  6. 聊聊JavaScript-闭包

    今天聊聊闭包,网上五花八门的定义和解释很多很多,是不是搞得你很懵逼:每次看闭包,都不同,本来自己懂,看完别人的之后就开始怀疑自己了.在我看来,闭包简单的说就是函数里面套函数,再往大了说就是我函数外面想 ...

  7. DQL、DML、DDL、DCL

    二. SQL语言的分类 SQL语言共分为四大类:数据查询语言DQL,数据操纵语言DML,数据定义语言DDL,数据控制语言DCL. 1. 数据查询语言DQL数据查询语言DQL基本结构是由SELECT子句 ...

  8. shell 批量创建带随机字符串的html文件

    思路一: echo $RANDOM|md5sum |tr "[0-9]" "[a-j]"|cut -c 2-11 RANDOM:  linux内置的随机数变量 ...

  9. python调试

    如果很简单的程序,建议还是pirnt打出来. 对于Linux环境,使用pdb/ipdb是一个不错的选择. 安装ipdb sudo pip install ipdb 开启调试 手动在需要调试的地方写入s ...

  10. 6.1 MSI/MSI-X Capability结构

    PCIe设备可以使用MSI或者MSI-X报文向处理器提交中断请求,但是对于某个具体的PCIe设备,可能仅支持一种报文.在PCIe设备中含有两个Capability结构,一个是MSI Capabilit ...