1.Query Processing
query processing is the study of techniques for query evaluation.
-insert affects only one tuple;
-delete does find-remove;
-update does find-change
评估query好坏主要依据是pages read/written cost,核心花销在disk, memory transfer is the highest cost in system。
在processing过程中,sql要解析为RA,通常select是projection,where是selection/join,from是join。
2.Transaction Processing
transaction的前提是多人的不同操作彼此之间可能出现冲突,如果只是本地单机处理数据,不会有transaction的问题。为了提高效率,数据库往往要在同时向多个用户开放,他们之间的操作要保证data integrity(ATID--Atomic, Consistent, Isolated, Durable),所以有了探讨的价值。
除了transaction processing外,concurrency control和recovery mechanism也非常重要。
Serial Schedule指的是两个nodes按顺序操作database,serial保证了consistent final state,不会出现node之间的冲突问题。
Concurrent Schedule允许多个node交叉操作database,有可能出现conflict,如果交叉操作依然能实现serial,就称为serializability,反之。
3.Concurrency Control
常用保证date integrity的方法包括:
-lock-based,当某个node的操作可能与其他node出现冲突时,锁定局部或全部table,其他node不能同时进行操作;
-version-based,使用版本控制来保证integrity,但是不是所有的情况都可以用这种方式;
-timestamp-based,给操作以时间标签来管理;
-validation-based
lock a small item can allow more of database accessible and quick lock release, while causes the problem of more lock management.