Patent ID: 8090691

Claim:
A method for variable block logging with log-ahead buffers, comprising: receiving one or more records associated with one or more database transactions; logging the one or more records into a current log buffer until the current log buffer has been filled or an event that requests committing the current log buffer to a storage device occurs; performing a current write operation to commit the one or more records logged in the current log buffer to a track on the storage device in response to determining that the current log buffer has been filled or the event that requests committing the current log buffer to the storage device has occurred, wherein performing the current write operation includes: activating a free or new log buffer; logging one or more new records received during the current write operation into the activated log buffer substantially concurrently with the current write operation committing the one or more records logged in the current log buffer to the track on the storage device; determining whether the track on the storage device has additional space subsequent to the current write operation committing the one or more records logged in the current log buffer to the track on the storage device; and committing at least one of the one or more new records logged in the activated log buffer to the additional space associated with the track on the storage device during the current write operation in response to determining that the track on the storage device has the additional space; collecting statistics involving the current log buffer and the activated log buffer, wherein the collected statistics include a number of times that the current log buffer and the activated log buffer have been activated, a number of times that the current log buffer has been filled and a transaction wait until the current log buffer has been freed occurs, and a number of times that the database manager used chained input/output to perform multiple write operations in one write request; and dynamically determining a number of available lop; buffers and a size associated with the available log buffers based on the collected statistics, wherein dynamically determining the number of available log buffers and the size associated with the available log buffers includes: increasing the number of available log buffers in response to determining that the number of times that the transaction wait has occurred includes a high count; increasing the number of available log buffers or the size associated with the available log buffers during high system usage; and decreasing the number of available log buffers or the size associated with the available log buffers during low system usage.