# US 10,956,416 B2 · Data schema discovery with query optimization

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

- Number: US 10,956,416 B2
- Document ID: US10956416B2
- Status: Granted
- Kind: B2
- Application number: 16/299,759
- Filed: 2019-03-12
- Published: 2020-09-17
- Granted: 2021-03-23
- Earliest claimed: 2019-03-12
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Juliana Medeiros Destro; Eduardo Luiz Lopes; Helio Pinheiro E Mota
- Web page: https://patentgrep.com/patent/US10956416B2

## CPC

- G06F 16/24535: {of sub-queries or views}
- G06F 16/433: {using audio data}
- G06F 16/213: {with details for schema evolution support}
- G06F 16/2453: Query optimisation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments for implementing schema discovery and query optimization by a processor. A schema may be created from one or more histograms of one or more keys and data types of a database and capable of being adapted and recalculated. One or more queries may be assembled according to the schema. One or more indexes and views may be suggested according to the one or more queries and the schema.

## Claims

### Claim 1

A method for implementing schema discovery and query optimization by a processor, comprising:
creating a schema from one or more histograms of one or more keys and data types of a database, wherein the schema is capable of being adapted and recalculated;
assembling one or more queries according to the schema by receiving an input of the one or more queries using a prefix notation, and reversing the prefix notation prior to processing the one or more queries;
processing the one or more queries having the reversed prefix notation by translating the one or more queries into a query JavaScript Object Notation (JSON) object;
suggesting one or more indexes and views according to the one or more queries and the schema; and
generating the one or more indexes and views for one or more similar data types according to a usage rank, the data types, and the schema received from a metadata repository.

### Claim 2 (depends on 1)

The method of claim 1, further including receiving, from the database, one or more keys extracted from data and the data types.

### Claim 3 (depends on 2)

The method of claim 2, further including adding the one or more keys used in the one or more queries to the usage rank, wherein the usage rank indicates a number of occurrences of a query of the one or more queries.

### Claim 4

A system for implementing schema discovery and query optimization, comprising:
one or more computers having one or more hardware processors in communication with one or more memory, the one or more memory storing executable instructions that when executed by the one or more hardware processors cause the one or more hardware processors to:
create a schema from one or more histograms of one or more keys and data types of a database, wherein the schema is capable of being adapted and recalculated;
assemble one or more queries according to the schema by receiving an input of the one or more queries using a prefix notation, and reversing the prefix notation prior to processing the one or more queries;
process the one or more queries having the reversed prefix notation by translating the one or more queries into a query JavaScript Object Notation (JSON) object;
suggest one or more indexes and views according to the one or more queries and the schema; and
generate the one or more indexes and views for one or more similar data types according to a usage rank, the data types, and the schema received from a metadata repository.

### Claim 5 (depends on 4)

The system of claim 4, wherein, when executed by the one or more hardware processors, the executable instructions further cause the one or more hardware processors to receive, from the database, one or more keys extracted from data and the data types.

### Claim 6 (depends on 5)

The system of claim 5, wherein, when executed by the one or more hardware processors, the executable instructions further cause the one or more hardware processors to add the one or more keys used in the one or more queries to the usage rank, wherein the usage rank indicates a number of occurrences of a query of the one or more queries.

### Claim 7

A computer program product for implementing schema discovery and query optimization by a processor, the computer program product comprising a non-transitory computer-readable storage medium having computer-readable program code portions stored therein, the computer-readable program code portions comprising:
an executable portion that creates a schema from one or more histograms of one or more keys and data types of a database, wherein the schema is capable of being adapted and recalculated;
an executable portion that assembles one or more queries according to the schema by receiving an input of the one or more queries using a prefix notation, and reversing the prefix notation prior to processing the one or more queries;
an executable portion that processes the one or more queries having the reversed prefix notation by translating the one or more queries into a query JavaScript Object Notation (JSON) object;
an executable portion that suggests one or more indexes and views according to the one or more queries and the schema; and
an executable portion that generates the one or more indexes and views for one or more similar data types according to a usage rank, the data types, and the schema received from a metadata repository.

### Claim 8 (depends on 7)

The computer program product of claim 7, further including an executable portion that receives, from the database, one or more keys extracted from data and the data types.

### Claim 9 (depends on 8)

The computer program product of claim 8, further including an executable portion that adds the one or more keys used in the one or more queries to the usage rank, wherein the usage rank indicates a number of occurrences of a query of the one or more queries.
