高级检索

    一种基于属性谓词锁的数据库并发控制方法

    An Implementation of Attributive Predicate Lock in Database System

    • 摘要: 当前,在OLTP数据库的应用场景中,事务通常由一些简单的查询构成,尤其是大量存在的基于主键的读写事务.在这种应用场景下,逻辑锁能够避免复杂的逻辑判定,通过基于简单比较的语义封锁来防止不可重复读、幻象读等问题,从而实现事务的串行化调度.为了提高事务读写的并发能力,针对当前OLTP应用的特点,在谓词锁的基础上进一步细分锁粒度,提出属性谓词锁的理论,并在给定的复杂度内讨论了该理论在上述应用场景下的可行性.此外,通过在国产神通数据库的事务线程框架下模拟TPC-C的事务并发,一个测试属性谓词锁与物理行锁性能差异的实验得以顺利进行.对比实验结果表明,属性谓词锁在相对固定的属性列上进行简单查询和更新的应用中,可以大幅度地减少加锁的数目,从而在CPU和内存开销等性能指标上占据优势.

       

      Abstract: In todays application scenarios of OLTP database, transactions are generally made up of simple queries, especially ones based on primary keys. In such cases, the predicate lock based on semantics of simple comparisons can be used to solve the problem of Non-repeatable read and phantom read, which guarantees the serializable schedule of transactions, leaving out complex logical judgments. In consideration of the advantages of predicate lock, we propose an extended version called Attributive Predicate Lock, which supports modifications on different attribute domains in the same data row, thus improve the concurrent capabilities of transactions. We discuss the feasibility of this theory in the given complexity and OLAP application scenarios, and give a detailed implementation of such a lock system. Based on the theory and implementation, we also conduct a simulation of TPC-C concurrent transactions on the framework of transaction threads in the national ShenTong Database System, and compared its performance with that of physical lock system. The experiment results prove that Attributive Predicate Lock can schedule transactions correctly with better performance of CPU and memory in the scenario of simple queries and updates on fixed attribute columns, which will be of great improvement to the concurrent capabilities in OLAP applications.

       

    /

    返回文章
    返回