数据库系统实现译文(查询过程概述)

1.2.2 查询过程概述

许多同数据库系统的交互都依照于图1.1左边所示路径。用户或应用程序发出某些动作并不会影响到数据库的模式(对数据库结构描述的元数据),但很多操作会影响到数据库的内容(如果操作是修改命令的话),也可能从数据库中提取数据(如果操作是一个查询的话)。所以从用户操作对数据库的影响方式来划分的话会有两条执行路径。

The query is parsed and optimized by a query
compiler. The resulting query plan, or sequence of actions to be taken
to answer the query, is passed to the execution engine. The execution
engine issues a sequence of requests for small pieces of data, typically
records or tuples of a relation, to a resource manager that knows about
data files (holding relations), the format and size of records in those files,
and index files, which help find elements of data files quickly. The requests
for data are translated into pages and these requests are passed
to the buffer manager. We shall discuss the role of the buffer manager
in Section 1.2.3, but briefly, its task is to bring appropriate portions of
the data from secondary storage (disk, normally) where it is kept permanently,
to main-memory buffers. Normally, the page or "disk block" is
the unit of transfer between buffers and disk. The buffer manager communicates
with a storage manager to get data from disk. The storage
manager might involve operating-system commands, but more typically,
the DBMS issues commands directly to the disk controller.

1.对查询的回复。查询命令被查询编译器解析并优化,得到一个查询计划(该计划是由一系列的操作组成),这个查询计划被传到执行引擎。执行引擎据此计划发出一系列对小块数据的请求(这些小块数据一般是记录,或者是描述关系的元组),这些请求被发到资源管理器(资源管理器管理着数据文件,这些文件中包含着关系),在数据文件中可以得到记录的格式和大小,这些信息同索引文件一道为从数据文件中快速找到所要找的数据提供了帮助。对于数据的请求最终被转化为对页面的请求,并且这些请求被送到了缓存管理器中。我们将会在1.2.3中讨论缓存管理器。不过简单得说,缓存管理器的任务便是把数据的适当部分从存储它们的外存(通常是磁盘)加载到主存中的缓存区中。通常,页或者磁盘块是在缓存和磁盘间转化的基本单元。缓冲管理器通过与存储管理器通信来从磁盘得到数据。储存管理器可能会调用操作系统提供的接口,但更多的是DBMS直接向磁盘控制器发送命令。

Queries and other actions are grouped into transactions,
which are units that must be executed atomically and in isolation,
as discussed in the introduction to this chapter; often each query or modification
action is a transaction by itself. In addition, the execution of
transactions must be durable, meaning that the effect of any completed
transaction must be preserved even if the system fails in some way right
after completion of the transaction. We divide the transaction processor
into two major parts:
(a) A concurrency-control manager, (or scheduler), responsible for assuring
atomicity and isolation of transactions, and
(b) A logging and recovery manager responsible for the durability of
transactions.
We shall consider these components further in Section 1.2.4.

2.事务过程。查询和其他操作都被划分到了事务中。事务是必须是原子性的和隔离性的基本操作单元。通常查询和修改操作本身就是一个事务。另外事务的执行必须能持久化,也就是说,即使事务完成后系统在某些情况下出错了,该事务的任何影响都必须被记录。我们把事务处理器划分为两大部分:                                                         

(a)一个并发控制管理器(或称调度器)负责保证事务的原子性和隔离性

(b)一个日志和恢复管理器负责事务的持久化

我们将在1.2.4节更深入的了解这些组件。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值