Mysql 体系结构系列之四

前言:接上一篇Mysql 体系结构系列之三: 核心模块之间的交互

                Mysql 体系结构系列之三 : http://blog.csdn.net/u010993297/article/details/9617545

 

1. 核心模块之间的交互 Interaction of the Core Modules

<<-------第六段 讲的是命令调度器-查询高速缓存模块-解析器,连接线程-解析器------>>

 TheCommand Dispatcher forwards queries to the Parser through theQuery Cache Module.

命令调度器通过查询高速缓存模块将查询发送给解析器。

 

The Query Cache Module checks whether the query is of the type that can be cached, and if there exists a previously computed cached result that is still valid.

查询高速缓存模块检查查询的两个条件:1.查询是否是可高速缓存的类型。2.查询是否存在一个仍然有效的、以前计算得出的高速缓存结果。

 

--下面是两种情况,找到目标/没有找到目标

In the case of a hit, the execution is short-circuited at this point, the cached result isreturned to the user, and theConnection Thread receives control and is now ready to process another command.

如果找到,则在该点执行短路,高速缓存结果被返回给用户,连接线程接收控制权,这时准备处理另一个命令。

 

If the Query Cache Module reports a miss, the query goes to the Parser, which will make a decision on how to transfer control based on the query type.

如果查询高速缓存模块报告没有找到目标,那么查询被发送给解析器,由解析器根据查询类型决定如何传送控制权。

 

<<-------第七段 讲的是优化器,表修改模块,表维护模块,复制模块,状态报告模块------>>

One can identify the following modules that could continue from that point: theOptimizer, theTable Modification Module, the Table Maintenance Module, the Replication Module, and theStatus Reporting Module.

它们将从以上位置继续操作可以识别的模块分别是:优化器、表修改模块、表维护模块、复制模块及状态报告模块。

 

--优化器、表修改模块对应的操作

Select queries are forwarded to theOptimizer; updates, inserts, deletes, and table-creation and schema-altering queries go to the respectiveTable Modification Modules;

选择查询被发送给优化器;

更新、插入、删除、表创建还有模式的变更的查询发送给表修改模块。

 

--表维护模块对应的操作

queries that check, repair,update key statistics, or defragment the table go to theTable Maintenance module;

检查、维修、更新键值统计、整理表碎片的查询发送给表维护模块。

 

--复制模块、状态报告模块对应的操作

queries related to replication go to theReplication Module; and status requests go to theStatus Reporting Module.

 

There also exist a number ofTable Modification Modules:Delete Module, Create Module, Update Module, Insert Module, and Alter Module.

同时还有大量表修改模块:删除模块、创建模块、更新模块、插入模块及更改模块。

 

<<-------第八段 讲的访问控制模块—表管理器 表操作模块-抽象存储引擎模块------>>

At this point, each of the modules that will receive control from theParser passes the list of tables involved in the query to theAccess Control Module and then, upon success,to the Table Manager, which opens the tables and acquires the necessary locks.

这时,每个将收到来自解析器的控制的模块都将参与查询的表列表传递给访问控制模块,传递成功后再传递给表管理器,表管理器打开各个表,取出所需要的锁。

 

Now the table operation moduleis ready to proceed with its specific task and willissue a number of requests to theAbstracted Storage Engine Module for low-leveloperations such as inserting or updating a record, retrieving the records based on akey value, or performing an operation on the table level, such as repairing it or updating the index statistics.

这时表操作模块准备继续执行特定任务,将向抽象存储引擎模块发出大量请求,要求执行各种低层次操作,诸如插入或更新记录、根据键值检索记录,或执行表层次级别的操作,如修复表、更新索引统计。

 

 

<<-------第九段 讲的是抽象存储引擎模块------>>

The Abstracted Storage Engine Module will automatically translate the calls to thecorresponding methods of the specificStorage Engine Module via object polymorphism.

抽象存储引擎模块将通过对象多态性自动地调用转换为特定存储引擎模块的相应方法。

 

In other words, when dealing with aStorage Engine object, the caller thinks itis dealing with an abstracted one, when in fact the object is of a more specific type: it is theStorage Engine object corresponding to the given table type. The interfacemethods are virtual, which creates the effect of transparency. The correct methodwill be called, and the caller does not need to be aware of the exact object type of the Storage Engine object.

换言之,在处理存储引擎对象的时候,调用端会认为自己在处理一个抽象的对象,而实际上该对象属于某种特定类型,即与给定表类型相对应的存储引擎对象。

接口方法为虚拟方法,它产生了透明的效果,调用端不需要了解存储引擎对象的确切对象类型,就能调用正确的方法。

 

待续。。。。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值