The invention discloses a method for recording event logs and a
database engine, and belongs to the technical field of databases. The method includes the steps that an
SQL request is received; according to the
SQL request, data pages corresponding to the
SQL request are modified; corresponding event logs are generated for the modification; the event logs are partitioned to obtain a plurality of log segments, the log segments are written into a plurality of buffer queues, and the log segments in the buffer queues are written into a log file. The
database engine comprises a receiving module, a modifying module, a generating module and writing-in module. According to the method for recording event logs and the
database engine, the event logs can be recorded in parallel; due to the fact that the buffer queues are multiple and written into the log file in a
parallel processing mode, not only is the lock
granularity of the event log buffer queues reduced, but also the speed for writing the log file into a disk is greatly increased, the performance of a database
system is improved, and user experience is improved.