发明名称 Method for recording transaction log, and database engine
摘要 A method for recording a transaction log, and a database engine, and pertains to the field of database technologies. The method includes receiving an structured query language (SQL) request; modifying, according to the SQL request, a data page corresponding to the SQL request; generating a corresponding transaction log for the modifying; partitioning the transaction log to obtain a plurality of log segments; and writing the plurality of log segments into a plurality of log buffers, and writing the log segments in the plurality of log buffers into a log file in parallel. According to the present invention, not only lock granularities of the log buffers of the transaction log are reduced, but also a speed at which a log file is written into a magnetic disk is greatly increased, thereby improving performance of a database system and enhancing user experience.
申请公布号 US9189487(B2) 申请公布日期 2015.11.17
申请号 US201514721600 申请日期 2015.05.26
申请人 Huawei Technologies Co., Ltd. 发明人 Yu Wei;Liu Huijun;Nie Yuanyuan
分类号 G06F17/30;G06F11/14 主分类号 G06F17/30
代理机构 Conley Rose, P.C. 代理人 Conley Rose, P.C. ;Rodolph Grant;Beaulieu Nicholas K.
主权项 1. A method for recording a transaction log comprising: receiving a structured query language (SQL) request; modifying, according to the SQL request data page corresponding to the SQL request; generating a corresponding transaction log for the modifying; partitioning the transaction log to obtain a plurality of log segments; and writing, in parallel, the plurality of log segments into a plurality of log buffers, and the log segments in the plurality of log buffers into a log file, wherein partitioning the transaction log to obtain the plurality of log segments and writing, in parallel, the plurality of log segments into the plurality of log buffers, and the log segments in the plurality of log o file comprises: determining a type of the transaction log,partitioning the transaction log to obtain the plurality of log segments when the type of the transaction log is a parallel execution log;writing the plurality of log segments into a plurality of parallel execution log buffers; andwriting the log segments in the plurality of log buffers into a plurality of parallel execution log files in parallel, wherein the parallel execution log refers to a transaction log that is generated when the modifying is modifying during which a sequence does not need to be ensured, and wherein partitioning the transaction log to obtain the plurality of log segments and writing the plurality of log segments into a plurality of parallel execution log buffers comprises: determining, according to a file number, a page number, and a position on a page of each record in the transaction log and according to a preset rule, a parallel execution log buffer corresponding to each record; andwriting each record into the corresponding log buffer in parallel, wherein the preset rule is that records related to a same data page correspond to a same parallel execution log buffer.
地址 Shenzhen CN