# US 2021/0334273 A1 · Index contention under high concurrency in a database system

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

- Number: US 2021/0334273 A1
- Document ID: US20210334273A1
- Status: Published application
- Kind: A1
- Application number: 16/858,856
- Filed: 2020-04-27
- Published: 2021-10-28
- Earliest claimed: 2020-04-27
- Assignees: salesforce.com, inc.
- Applicants: Salesforce.com, Inc.
- Inventors: Rohitashva MATHUR
- Web page: https://patentgrep.com/patent/US20210334273A1

## CPC

- G06F 16/2455: Query execution
- G06F 16/2458: Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F 16/2477: {Temporal data queries}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A database query message may be received at a database system via a network. The database query message may include one or more parameters for retrieving data from a database based on a designated database record insertion timestamp. A database query may be executed against the database system to retrieve one or more database records based on a database record insertion timestamp range determined based on the designated database record insertion timestamp and including a plurality of database record insertion timestamp values.

## Claims

### Claim 1

A method comprising:
receiving a database query message at a database system via a network, the database query message including one or more parameters for retrieving data from a database based on a designated database record insertion timestamp;
executing a database query against the database system to retrieve one or more database records based on a database record insertion timestamp range, the database record insertion timestamp range determined based on the designated database record insertion timestamp, the database record insertion timestamp range including a plurality of database record insertion timestamp values, wherein a designated database record inserted into the database at a time corresponding to the designated database record insertion timestamp is associated with one of the plurality of database record insertion timestamp values; and
transmitting a response message via the network, the response message identifying the one or more database records.

### Claim 2 (depends on 1)

The method recited in claim 1, wherein each of the plurality of database record insertion timestamp values is temporally located after the designated database record insertion timestamp, and wherein the one or more parameters indicate a request to receive database records temporally located before the designated database record insertion timestamp, and wherein identifying the database record insertion timestamp range involves adding a designated value to the designated database record insertion timestamp.

### Claim 3 (depends on 1)

The method recited in claim 1, wherein each of the plurality of database record insertion timestamp values is temporally located before the designated database record insertion timestamp, and wherein the one or more parameters indicate a request to receive database records temporally located after the designated database record insertion timestamp, and wherein identifying the database record insertion timestamp range involves subtracting a designated value from the designated database record insertion timestamp.

### Claim 4 (depends on 1)

The method recited in claim 1, wherein the database query includes a first stage identifying a first plurality of database records based on the database record insertion timestamp range, and wherein the database query includes a second stage identifying a second plurality of database records based on the designated database record insertion timestamp, the second plurality of database records being a subset of the first plurality of database records.

### Claim 5 (depends on 4)

The method recited in claim 4, wherein each of the first plurality of database records is associated with a respective adjusted database record insertion timestamp value, and wherein the first plurality of database records are identified by comparing the respective adjusted database record insertion timestamp values to the database record insertion timestamp range.

### Claim 6 (depends on 5)

The method recited in claim 5, wherein each of the first plurality of database records is associated with a respective original database record insertion timestamp value, and wherein the second plurality of database records are identified by comparing the respective original database record insertion timestamp values to the designated database record insertion timestamp.

### Claim 7 (depends on 1)

The method recited in claim 1, wherein the designated database record insertion timestamp is mapped to one of the plurality of database record insertion timestamp values via a timestamp mapping function.

### Claim 8 (depends on 7)

The method recited in claim 7, wherein the timestamp mapping function includes a hash function portion that receives as inputs a primary key associated with the designated database record and the designated database record insertion timestamp.

### Claim 9 (depends on 7)

The method recited in claim 7, wherein the timestamp mapping function is invertible, and wherein executing a second stage of the database query involves inverting the timestamp mapping function for each of a first plurality of database records retrieved in a first stage of the database query.

### Claim 10 (depends on 7)

The method recited in claim 7, wherein the timestamp mapping function includes a random number generation portion that returns a randomly generated number within a range of possible values.

### Claim 11 (depends on 7)

The method recited in claim 7, wherein the timestamp mapping function includes a modulo function that receives as an input the designated database record insertion timestamp.

### Claim 12 (depends on 1)

The method recited in claim 1, wherein each of the plurality of database record insertion timestamp values is temporally proximate to the designated database record insertion timestamp.

### Claim 13 (depends on 1)

The method recited in claim 1, wherein the database query message is received from an application in an on-demand computing services environment providing computing services to a plurality of organizations via the internet.

### Claim 14 (depends on 13)

The method recited in claim 13, wherein the database system is a multitenant database system in which one or more database tables within the database each stores information associated with two or more of the plurality of organizations.

### Claim 15 (depends on 1)

The method recited in claim 1, the method further comprising:
creating the database query by applying a transformation to the one or more parameters, the database query including one or more filters based on database record insertion timestamp values, the one or more parameters not including the one or more filters.

### Claim 16

A database system implemented using a server system, the database system configurable to perform a method comprising:
receiving a database query message via a network, the database query message including one or more parameters for retrieving data from a database based on a designated database record insertion timestamp;
executing a database query against the database system to retrieve one or more database records based on a database record insertion timestamp range, the database record insertion timestamp range determined based on the designated database record insertion timestamp, the database record insertion timestamp range including a plurality of database record insertion timestamp values, wherein a database record inserted into the database at a time corresponding to the designated database record insertion timestamp is associated with one of the plurality of database record insertion timestamp values; and
transmitting a response message via the network, the response message identifying the one or more database records.

### Claim 17 (depends on 16)

The database system recited in claim 16, wherein each of the plurality of database record insertion timestamp values is temporally located after the designated database record insertion timestamp, and wherein the one or more parameters indicate a request to receive database records temporally located before the designated database record insertion timestamp, and wherein identifying the database record insertion timestamp range involves adding a designated value to the designated database record insertion timestamp.

### Claim 18 (depends on 16)

The database system recited in claim 16, wherein the database query includes a first stage identifying a first plurality of database records based on the database record insertion timestamp range, wherein the database query includes a second stage identifying a second plurality of database records based on the designated database record insertion timestamp, the second plurality of database records being a subset of the first plurality of database records, wherein each of the first plurality of database records is associated with a respective adjusted database record insertion timestamp value, and wherein the first plurality of database records are identified by comparing the respective adjusted database record insertion timestamp values to the database record insertion timestamp range, wherein each of the first plurality of database records is associated with a respective original database record insertion timestamp value, and wherein the second plurality of database records are identified by comparing the respective original database record insertion timestamp values to the designated database record insertion timestamp.

### Claim 19 (depends on 16)

The database system recited in claim 16, wherein the designated database record insertion timestamp is mapped to one of the plurality of database record insertion timestamp values via a timestamp mapping function.

### Claim 20

One or more non-transitory computer-readable media having stored thereon computer instructions capable of causing a computer to perform a method, the method comprising:
receiving a database query message at a database system via a network, the database query message including one or more parameters for retrieving data from a database based on a designated database record insertion timestamp;
executing a database query against the database system to retrieve one or more database records based on a database record insertion timestamp range, the database record insertion timestamp range determined based on the designated database record insertion timestamp, the database record insertion timestamp range including a plurality of database record insertion timestamp values, wherein a database record inserted into the database at a time corresponding to the designated database record insertion timestamp is associated with one of the plurality of database record insertion timestamp values; and
transmitting a response message via the network, the response message identifying the retrieved database records.
