Method for deallocating a log in database systems
First Claim
1. In a database system, said database system maintaining a log for recording transactions which occur in said system, an improved method for deallocating log pages during archiving of the log, the method comprising:
- storing information about the transactions which occur in the system as a plurality of log records, said log records being stored together on a plurality of log pages, a number of said log pages being stored together as an allocation unit;
receiving a request to dump certain ones of said log records to an archive device;
determining which allocation units stores said certain ones of said log records to archive;
for said determined allocation units, determining first and last log pages for said certain ones of said log records to be dumped to the archive device; and
for each allocation unit determine to store said certain ones of said log records, deallocating log pages by at least performing;
if an allocation unit is completely filled with log records to be deallocated, deallocating those log records by marking the allocation unit as having deallocated log pages, the step being performed without fetching any log pages for the allocation unit.
1 Assignment
0 Petitions
Accused Products
Abstract
A SQL database server system having an enhanced logging system is described. The logging system implements a "private log cache" (PLC) for reducing the contention on the system'"'"'s "log" resource (which is protected by a log semaphore). An area of memory private to a user'"'"'s task is set aside as a PLC--a cache where log records are built and stored before being posted to the log. Each PLC may hold multiple log records for a single transaction before they are flushed to the log (page chain) through the log semaphore. When a transaction commits or the memory fills with log records, the PLC associated with the transaction is flushed to the log. Also described is improved log deallocation methodology provided by the system which alleviates the needs to read each of the log pages to be deallocated, as was conventionally required. The operation to do the deallocation occurs at the allocation page, not at the individual pages (which are to be deallocated). In accordance with this method, the system writes a log record which includes the first page and the last page of the run (i.e., the number of those pages). The system need not, however, read any of the pages of the run, other than the first page and the last page. In a common case of a completely filled allocation unit, the system reads two pages--the first page and the last page--and writes one log record. As a result, the system reads far fewer log pages and writes but a single log record.
-
Citations
15 Claims
-
1. In a database system, said database system maintaining a log for recording transactions which occur in said system, an improved method for deallocating log pages during archiving of the log, the method comprising:
-
storing information about the transactions which occur in the system as a plurality of log records, said log records being stored together on a plurality of log pages, a number of said log pages being stored together as an allocation unit; receiving a request to dump certain ones of said log records to an archive device; determining which allocation units stores said certain ones of said log records to archive; for said determined allocation units, determining first and last log pages for said certain ones of said log records to be dumped to the archive device; and for each allocation unit determine to store said certain ones of said log records, deallocating log pages by at least performing; if an allocation unit is completely filled with log records to be deallocated, deallocating those log records by marking the allocation unit as having deallocated log pages, the step being performed without fetching any log pages for the allocation unit. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
Specification