摘要 |
A method and database engine for recording a transaction log, related to the technical field databases. The method comprises: receiving a SQL request; modifying, on the basis of the SQL request, a data page corresponding to the SQL request; generating a corresponding transaction log for the modification; partitioning the transaction log to acquire multiple log fragments, writing the multiple log fragments into multiple buffer queues, and in parallel, writing log fragments in the multiple buffer queues into a log file. The database engine comprises: a receiving module, a modifying module, a generating module, and a write module. This implements parallel recording of transaction logs, and because multiple buffer queues are provided and writing into a log file is processed in a parallel mode, not only is the lock granularity of the transaction log buffer queues reduced, but the speed at which the log file is written into a magnetic disk also is greatly improved, thus increasing the performance of a database system, and enhancing user experience. |