关系型数据库工作原理-数据库查询器(19)

本文翻译自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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值