# US 2025/0156403 A1 · Multiple index scans

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

- Number: US 2025/0156403 A1
- Document ID: US20250156403A1
- Status: Published application
- Kind: A1
- Application number: 19/025,385
- Filed: 2025-01-16
- Published: 2025-05-15
- Earliest claimed: 2021-12-29
- Assignees: Salesforce, Inc.
- Applicants: Salesforce, Inc.
- Inventors: Colm McHugh; Rama K. Korlapati; Yi Xia
- Web page: https://patentgrep.com/patent/US20250156403A1

## CPC

- G06F 16/2255: {Hash tables}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are disclosed relating to implementing multiple index scans. A computer system may store a database table comprising fields and indexes corresponding to those fields. The computer system may receive a request to access records based on a Boolean expression that affects a selection of records from the database table and that comprises clauses, at least two of which are joined by an AND operation. The computer system may access the requested records. The accessing may include, for a given one of the at least two clauses, performing an index scan on an index that corresponds to the given clause to identify records that satisfy that clause. The computer system may update a hash table based on the identified records and then identify the requested records based on the hash table. The Boolean expression may include clauses joined by an OR operation that are processed using multiple index scans.

## Claims

### Claim 1

A method, comprising:
a computer system storing:
a database table comprising a plurality of fields; and
a plurality of indexes corresponding to at least two of the plurality of fields;
the computer system receiving a request to access a set of records included in the database table, wherein the request specifies a Boolean expression that affects a selection of records from the database table and comprises a plurality of clauses, at least two of which are joined by an OR operation; and
the computer system accessing the set of records, wherein the accessing includes:
performing index scans on ones of the plurality of indexes that correspond to the at least two clauses joined by the OR operation, wherein a first index scan of the index scans returns records that satisfy a first clause and a second index scan of the index scans returns records that satisfy a second clause but do not satisfy the first clause; and
aggregating results returned from the index scans to derive at least a portion of the requested set of records; and
the computer system returning the requested set of records to an issuer of the request.

### Claim 2 (depends on 1)

The method of claim 1, wherein the aggregating of the results includes performing union operations between sets of records that are returned from the index scans to derive the portion of the requested set of records.

### Claim 3 (depends on 1)

The method of claim 1, wherein a third index scan of the index scans returns records that satisfy a third clause of the plurality of clauses but do not satisfy the first and second clauses.

### Claim 4 (depends on 1)

The method of claim 1, wherein the plurality of clauses includes at least two clauses that are joined by an AND operation, and wherein the accessing includes:
for a given one of the at least two clauses joined by the AND operation, performing an index scan on one of the plurality of indexes that corresponds to the given clause to identify records that satisfy the given clause;
updating a hash table based on the identified records; and
identifying another portion of the requested set of records based on the hash table.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
the computer system maintaining, in the hash table, a count value for each unique primary key included in the identified records; and
the computer system identifying a set of primary keys associated with a count value that matches a number of index scans performed in association with the AND operation, wherein the other portion includes records corresponding to the set of primary keys.

### Claim 6 (depends on 1)

The method of claim 1, wherein records stored in the database table are not associated with respective row identifiers.

### Claim 7 (depends on 1)

The method of claim 1, wherein the accessing is performed without using bitmaps.

### Claim 8

A non-transitory computer readable medium having program instructions stored thereon that are capable of causing a computer system to perform operations comprising:
storing a database table comprising a plurality of fields;
storing a plurality of indexes corresponding to at least two of the plurality of fields;
receiving a request to access a set of records included within the database table, wherein the request specifies a Boolean expression that affects a selection of records from the database table and comprises a plurality of clauses, at least two of which are joined by an OR operation; and
accessing the set of records, wherein the accessing includes:
performing index scans on ones of the plurality of indexes that correspond to the at least two clauses joined by the OR operation, wherein a first index scan of the index scans returns records that satisfy a first clause and a second index scan of the index scans returns records that satisfy a second clause; and
aggregating results returned from the index scans to derive at least a portion of the requested set of records, wherein the aggregating includes performing a union operation between the records returned from the first index scan and the records returned from the second index scan; and
returning the requested set of records to an issuer of the request.

### Claim 9 (depends on 8)

The non-transitory computer readable medium of claim 8, wherein the union operation produces an aggregated set of records, and wherein the operations further comprise removing duplicate records from the aggregated set of records to derive the portion of the requested set of records.

### Claim 10 (depends on 9)

The non-transitory computer readable medium of claim 9, wherein the removing of the duplicate records includes sorting the aggregated set of records by primary key to derive a sorted list and traversing the sorted list to identify the duplicate records.

### Claim 11 (depends on 8)

The non-transitory computer readable medium of claim 8, wherein the records returned from the second index scan do not satisfy the first clause.

### Claim 12 (depends on 8)

The non-transitory computer readable medium of claim 8, wherein the plurality of clauses includes at least two clauses joined by an AND operation, and wherein the accessing includes:
for a given one of the at least two clauses joined by the AND operation, performing an index scan on one of the plurality of indexes that corresponds to the given clause to identify records that satisfy the given clause;
updating a hash table based on the identified records; and
identifying another portion of the requested set of records based on the hash table.

### Claim 13 (depends on 12)

The non-transitory computer readable medium of claim 12, wherein the operations further comprise:
maintaining, in the hash table, a count value for each unique primary key included in the identified records, wherein a count value for a given primary key indicates a number of occurrences of a record in index scans performed for the at least two clauses joined by the AND operation that includes the given primary key; and
determining a set of primary keys associated with a count value that matches a number of index scans performed in association with the AND operation, wherein the other portion is identified based on the set of primary keys.

### Claim 14 (depends on 8)

The non-transitory computer readable medium of claim 8, wherein a third index scan of the index scans returns records that satisfy a third clause of the plurality of clauses but do not satisfy the first and second clauses.

### Claim 15

A system, comprising:
at least one processor; and
memory having program instructions stored thereon that are executable by the at least one processor to cause the system to perform operations comprising:
storing a database table comprising a plurality of fields;
storing a plurality of indexes corresponding to at least two of the plurality of fields;
receiving a request to access a set of records included within the database table, wherein the request specifies a Boolean expression that affects a selection of records from the database table and comprises a plurality of clauses, at least two of which are joined by an OR operation; and
accessing the set of records, wherein the accessing includes:
performing index scans on ones of the plurality of indexes that correspond to the at least two clauses joined by the OR operation, wherein a first index scan of the index scans returns records that satisfy a first clause and a second index scan of the index scans returns records that satisfy a second clause; and
aggregating results returned from the index scans to derive at least a portion of the requested set of records, wherein the aggregating includes performing a union operation between the records returned from the first index scan and the records returned from the second index scan; and
returning the requested set of records to an issuer of the request.

### Claim 16 (depends on 15)

The system of claim 15, wherein the operations further comprise:
sorting the aggregated results according to primary key; and
scanning the sorted aggregated results in order, wherein the scanning includes selecting, to derive the portion of the requested set of records, one record for each unique primary key of the aggregated results.

### Claim 17 (depends on 15)

The system of claim 15, wherein the operations further comprise:
updating a hash table based on the aggregated results; and
selecting records identified by the hash table to derive the portion of the requested set of records.

### Claim 18 (depends on 15)

The system of claim 15, wherein a particular index scan of the index scans returns records satisfying one of the at least two clauses joined by the OR operation but do not satisfy the other clauses of the at least two clauses joined by the OR operation.

### Claim 19 (depends on 15)

The system of claim 15, wherein at least two of the plurality of clauses are joined by an AND operation, and wherein the accessing includes:
for a given one of the at least two clauses joined by the AND operation, performing an index scan on one of the plurality of indexes that corresponds to the given clause to identify records that satisfy the given clause;
updating a hash table based on the identified records; and
determining another potion of the requested set of records based on the hash table.

### Claim 20 (depends on 19)

The system of claim 19, wherein a record of the other portion is determined based on the hash table indicating that the record was accessed in each index scan performed for the at least two clauses joined by the AND operation.
