# US 11,308,058 B1 · Building and using combined multi-type sub-indices to search NoSQL databases

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

- Number: US 11,308,058 B1
- Document ID: US11308058B1
- Status: Granted
- Kind: B1
- Application number: 17/140,397
- Filed: 2021-01-04
- Granted: 2022-04-19
- Earliest claimed: 2021-01-04
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Peng Hui Jiang; Xin Peng Liu; Shuo Li; Sheng Yan Sun; Xiaobo Wang; Yue Wang
- Web page: https://patentgrep.com/patent/US11308058B1

## CPC

- G06F 16/2264: {Multidimensional index structures}
- G06F 16/28: Databases characterised by their database models, e.g. relational or object models
- G06F 11/3409: {for performance assessment}
- G06F 16/2457: with adaptation to user needs
- G06F 16/248: Presentation of query results
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Building and using multiple different types of sub-indices to search a database is provided. A plurality of different physical data ranges is generated within the database based on a set of logical hot data ranges and a set of logical non-hot data ranges to form a set of physical hot data ranges and a set of physical non-hot data ranges. A set of sub-index types is built for each respective data range of the plurality of different physical data ranges within the database using a set of selected high-speed sub-index types for the set of physical hot data ranges and another set of selected sub-index types for the set of physical non-hot data ranges to accelerate data availability for query. An index is built for the database using the set of sub-index types built for each respective data range of the plurality of different physical data ranges within the database.

## Claims

### Claim 1

A computer-implemented method for building and using multiple different types of sub-indices to search a database, the computer-implemented method comprising:
generating, by a computer, a plurality of different physical data ranges within the database based on a set of logical hot data ranges and a set of logical non-hot data ranges of a plurality of different logical data ranges to form a set of physical hot data ranges and a set of physical non-hot data ranges;
building, by the computer, a set of sub-index types for each respective data range of the plurality of different physical data ranges within the database, wherein the set of sub-index types includes a set of selected high-speed sub-index types for the set of physical hot data ranges and includes a second set of selected sub-index types for the set of physical non-hot data ranges to accelerate data availability for query, wherein the set of selected high-speed sub-index types are different from the second set of selected sub-index types;
building, by the computer, an index for the database using the set of sub-index types built for each respective data range of the plurality of different physical data ranges within the database;
receiving, by the computer, a query of a particular search type requesting to perform an action on a physical data range within the database on the computer;
generating, by the computer, a result for the query based on a search of that physical data range within the database; and
outputting, by the computer, the result for the query.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1 further comprising:
receiving, by the computer, a request to build the index for the database of the computer;
responsive to receiving the request to build the index, identifying, by the computer, hot data and non-hot data within the database based on data usage metrics; and
dividing, by the computer, data in the database into the plurality of different logical data ranges based on identified hot data and identified non-hot data within the database to form the set of logical hot data ranges and the set of logical non-hot data ranges.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1 further comprising:
determining, by the computer, a cost to build each respective sub-index type of the set of sub-index types corresponding to each respective data range of the plurality of different physical data ranges within the database;
monitoring, by the computer, data usage within the database for a predetermined time interval; and
adjusting, by the computer, the plurality of different logical data ranges within the database based on monitored data usage within the database and determined cost of building each respective sub-index type.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1 further comprising:
responsive to receiving the query, detecting, by the computer, whether a set of sub-index types corresponding to that physical data range is available; and
determining, by the computer, whether a set of sub-index types is available for that physical data range based on the detecting.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4 further comprising:
responsive to the computer determining that a set of sub-index types is not available for that physical data range, utilizing, by the computer, a full-text scan to search that physical data range within the database.

### Claim 6 (depends on 4)

The computer-implemented method of claim 4 further comprising:
responsive to the computer determining that a set of sub-index types is available for that physical data range, determining, by the computer, whether a sub-index type corresponding to the particular search type of the query on that physical data range is available in the set of sub-index types for that physical data range;
responsive to the computer determining that a sub-index type corresponding to the particular search type of the query on that physical data range is not available in the set of sub-index types for that physical data range, converting, by the computer, the particular search type of the query to another search type that corresponds to another sub-index type in the set of sub-index types for that physical data range; and
utilizing, by the computer, said another sub-index type in the set of sub-index types for that physical data range to search that physical data range within the database to provide increased availability for the query.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6 further comprising:
responsive to the computer determining that a sub-index type corresponding to the particular search type of the query on that physical data range is available in the set of sub-index types for that physical data range, utilizing, by the computer, the sub-index type corresponding to the particular search type of the query to search that physical data range within the database.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein when the computer completes building a respective sub-index type for a particular data range, that respective sub-index type is ready and available to be used for query of that particular data range within the database even though the index for the database is not yet built.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, wherein the respective sub-index type is selected from a group consisting of a geospatial sub-index type, a B-tree sub-index type, and a full-text sub-index type.

### Claim 10 (depends on 1)

The computer-implemented method of claim 1, wherein different sub-index types corresponding to different physical data ranges have different weights for sub-index build priority.

### Claim 11 (depends on 1)

The computer-implemented method of claim 1, wherein the computer is a NoSQL server and the database is a NoSQL database.

### Claim 12

A computer system for building and using multiple different types of sub-indices to search a database, the computer system comprising:
a bus system;
a storage device connected to the bus system, wherein the storage device stores program instructions; and
a processor connected to the bus system, wherein the processor executes the program instructions to:
generate a plurality of different physical data ranges within the database based on a set of logical hot data ranges and a set of logical non-hot data ranges of a plurality of different logical data ranges to form a set of physical hot data ranges and a set of physical non-hot data ranges;
build a set of sub-index types for each respective data range of the plurality of different physical data ranges within the database, wherein the set of sub-index types includes a set of selected high-speed sub-index types for the set of physical hot data ranges and includes a second set of selected sub-index types for the set of physical non-hot data ranges to accelerate data availability for query, wherein the set of selected high-speed sub-index types are different from the second set of selected sub-index types;
build an index for the database using the set of sub-index types built for each respective data range of the plurality of different physical data ranges within the database;
receive a query of a particular search type requesting to perform an action on a physical data range within the database;
generate a result for the query based on a search of that physical data range within the database; and
output the result for the query.

### Claim 13 (depends on 12)

The computer system of claim 12, wherein the processor further executes the program instructions to:
receive a request to build the index for the database of the computer system; identify hot data and non-hot data within the database based on data usage metrics in response to receiving the request to build the index; and
divide data in the database into the plurality of different logical data ranges based on identified hot data and identified non-hot data within the database to form the set of logical hot data ranges and the set of logical non-hot data ranges.

### Claim 14

A computer program product for building and using multiple different types of sub-indices to search a database, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to perform a method of:
generating, by the computer, a plurality of different physical data ranges within the database based on a set of logical hot data ranges and a set of logical non-hot data ranges of a plurality of different logical data ranges to form a set of physical hot data ranges and a set of physical non-hot data ranges;
building, by the computer, a set of sub-index types for each respective data range of the plurality of different physical data ranges within the database, wherein the set of sub-index types includes a set of selected high-speed sub-index types for the set of physical hot data ranges and includes a second set of selected sub-index types for the set of physical non-hot data ranges to accelerate data availability for query, wherein the set of selected high-speed sub-index types are different from the second set of selected sub-index types;
building, by the computer, an index for the database using the set of sub-index types built for each respective data range of the plurality of different physical data ranges within the database;
receiving, by the computer, a query of a particular search type requesting to perform an action on a physical data range within the database on the computer;
generating, by the computer, a result for the query based on a search of that physical data range within the database; and
outputting, by the computer, the result for the query.

### Claim 15 (depends on 14)

The computer program product of claim 14 further comprising:
receiving, by the computer, a request to build the index for the database of the computer; responsive to receiving the request to build the index, identifying, by the computer, hot data and non-hot data within the database based on data usage metrics; and
dividing, by the computer, data in the database into the plurality of different logical data ranges based on identified hot data and identified non-hot data within the database to form the set of logical hot data ranges and the set of logical non-hot data ranges.

### Claim 16 (depends on 14)

The computer program product of claim 14 further comprising:
determining, by the computer, a cost to build each respective sub-index type of the set of sub-index types corresponding to each respective data range of the plurality of different physical data ranges within the database;
monitoring, by the computer, data usage within the database for a predetermined time interval; and
adjusting, by the computer, the plurality of different logical data ranges within the database based on monitored data usage within the database and determined cost of building each respective sub-index type.

### Claim 17 (depends on 14)

The computer program product of claim 14 further comprising:
responsive to receiving the query, detecting, by the computer, whether a set of sub-index types corresponding to that physical data range is available; and
determining, by the computer, whether a set of sub-index types is available for that physical data range based on the detecting.

### Claim 18 (depends on 17)

The computer program product of claim 17 further comprising:
responsive to the computer determining that a set of sub-index types is not available for that physical data range, utilizing, by the computer, a full-text scan to search that physical data range within the database.

### Claim 19 (depends on 17)

The computer program product of claim 17 further comprising:
responsive to the computer determining that a set of sub-index types is available for that physical data range, determining, by the computer, whether a sub-index type corresponding to the particular search type of the query on that physical data range is available in the set of sub-index types for that physical data range;
responsive to the computer determining that a sub-index type corresponding to the particular search type of the query on that physical data range is not available in the set of sub-index types for that physical data range, converting, by the computer, the particular search type of the query to another search type that corresponds to another sub-index type in the set of sub-index types for that physical data range; and
utilizing, by the computer, said another sub-index type in the set of sub-index types for that physical data range to search that physical data range within the database to provide increased availability for the query.

### Claim 20 (depends on 19)

The computer program product of claim 19 further comprising:
responsive to the computer determining that a sub-index type corresponding to the particular search type of the query on that physical data range is available in the set of sub-index types for that physical data range, utilizing, by the computer, the sub-index type corresponding to the particular search type of the query to search that physical data range within the database.
