# US 11,487,740 B2 · Reduce log contention by batching log record transfers to the log

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,487,740 B2
- Document ID: US11487740B2
- Status: Granted
- Kind: B2
- Application number: 17/024,552
- Filed: 2020-09-17
- Published: 2021-01-07
- Granted: 2022-11-01
- Earliest claimed: 2014-03-13
- Assignees: Sybase, Inc.
- Applicants: Sybase, Inc.
- Inventors: Fei Zhou; Sarika Iyer; Graham Ivey
- Web page: https://patentgrep.com/patent/US11487740B2

## CPC

- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 16/24552: {Database cache management}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system for managing database logging, the comprises a processor; and a user task executing in a database server process and executable by the processor, the user task to: receive in a database management system on a database server, a command to manipulate a portion of a database managed by the database management system; obtain a lock on the portion of the database; create a first log record in a first private log cache associated with the user task, the first log record recording a data manipulation to the portion of the database; enqueue the first log record to a queue; and release the lock on the portion of the database after copying the first log record to the queue.

## Claims

### Claim 1

A method comprising:
creating, by one or more processors, a log record in a private log cache that corresponds to a user task, the created log record indicating a data operation to be performed on a portion of a database;
enqueuing, by the one or more processors, the log record into a queue before the log record is written to an in-memory version of a transaction log distinct from the queue, the enqueuing the log record into the queue comprising adding, to the queue, a pointer to a memory location of the log record in the private log cache;
writing, by the one or more processors, the log record into the in-memory version of the transaction log after the enqueuing of the log record into the queue distinct from the transaction log; and
writing, by the one or more processors, the log record into a disk version of the transaction log.

### Claim 2 (depends on 1)

The method of claim 1, wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is in response to the private log cache becoming full.

### Claim 3 (depends on 1)

The method of claim 1, wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is in response to a command to commit a transaction that corresponds to the user task.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
obtaining a lock on the portion of the database; and wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is performed after the obtaining of the lock on the portion of the database.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
obtaining a lock on the portion of the database; and
releasing the lock on the portion of the database after the enqueuing of the log record into the queue.

### Claim 6 (depends on 1)

The method of claim 1, wherein:
the queue is shared among a plurality of user tasks and configured to store references to enqueued log records that correspond to the plurality of user tasks before the enqueued log records are written to in-memory versions of transaction logs distinct from the queue.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
receiving a command to commit the data operation to be performed on the portion of the database; and
writing log records enqueued earlier than the log record from the queue to the disk version of the transaction log.

### Claim 8 (depends on 7)

The method of claim 7, wherein:
the log record is a first log record;
the private log cache is a first private log cache; and
the method further comprises:
accessing a second private log cache that includes a second log record older than the first log record in the first private log cache; and
writing the second log record into the disk version of the transaction log.

### Claim 9

A system comprising:
one or more processors; and
a memory storing instructions that, when executed by at least one processor among the one or more processors, cause the system to perform operations comprising:
creating a log record in a private log cache that corresponds to a user task, the created log record indicating a data operation to be performed on a portion of a database;
enqueuing the log record into a queue before the log record is written to an in-memory version of a transaction log distinct from the queue, the enqueuing the log record into the queue comprising adding, to the queue, a pointer to a memory location of the log record in the private log cache;
writing the log record into the in-memory version of the transaction log after the enqueuing of the log record into the queue distinct from the transaction log; and
writing the log record into a disk version of the transaction log.

### Claim 10 (depends on 9)

The system of claim 9, wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is in response to the private log cache becoming full.

### Claim 11 (depends on 9)

The system of claim 9, wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is in response to a command to commit a transaction that corresponds to the user task.

### Claim 12 (depends on 9)

The system of claim 9, wherein the operations further comprise:
obtaining a lock on the portion of the database; and wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is performed after the obtaining of the lock on the portion of the database.

### Claim 13 (depends on 9)

The system of claim 9, wherein the operations further comprise:
obtaining a lock on the portion of the database; and
releasing the lock on the portion of the database after the enqueuing of the log record into the queue.

### Claim 14 (depends on 9)

The system of claim 9, wherein:
the queue is shared among a plurality of user tasks and configured to store references to enqueued log records that correspond to the plurality of user tasks before the enqueued log records are written to in-memory versions of transaction logs distinct from the queue.

### Claim 15 (depends on 9)

The system of claim 9, wherein the operations further comprise:
receiving a command to commit the data operation to be performed on the portion of the database; and
writing log records enqueued earlier than the log record from the queue to the disk version of the transaction log.

### Claim 16

A non-transitory machine-readable storage medium comprising instructions that, when executed by one or more processors of a machine, cause the machine to perform operations comprising:
creating a log record in a private log cache that corresponds to a user task, the created log record indicating a data operation to be performed on a portion of a database;
enqueuing the log record into a queue before the log record is written to an in-memory version of a transaction log distinct from the queue, the enqueuing the log record into the queue comprising adding, to the queue, a pointer to a memory location of the log record in the private log cache;
writing the log record into the in-memory version of the transaction log after the enqueuing of the log record into the queue distinct from the transaction log; and
writing the log record into a disk version of the transaction log.

### Claim 17 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is in response to the private log cache becoming full.

### Claim 18 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is in response to a command to commit a transaction that corresponds to the user task.

### Claim 19 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, wherein the operations further comprise:
obtaining a lock on the portion of the database; and wherein:
the enqueuing of the log record into the queue before the log record is written to the in-memory version of the transaction log is performed after the obtaining of the lock on the portion of the database.

### Claim 20 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, wherein the operations further comprise:
obtaining a lock on the portion of the database; and
releasing the lock on the portion of the database after the enqueuing of the log record into the queue.
