# US 9,355,147 B2 · Access plan for a database query

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

- Number: US 9,355,147 B2
- Document ID: US9355147B2
- Status: Granted
- Kind: B2
- Application number: 14/179,995
- Filed: 2014-02-13
- Published: 2015-08-13
- Granted: 2016-05-31
- Earliest claimed: 2014-02-13
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Adam D. Braham; Andrew P. Passe
- Web page: https://patentgrep.com/patent/US9355147B2

## CPC

- G06F 16/24545: {Selectivity estimation or determination}
- G06F 16/24544: {Join order optimisation}
- G06F 16/2453: Query optimisation
- G06F 16/2456: {Join operations}
- G06F 16/2462: {Approximate or statistical queries}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system and method of creating an access plan for a database query is disclosed. The system and method include identifying a first portion of a column of a table of a database. The first portion of the column may be in a select statement of the database query. The system and method include estimating a first statistical value for the column. The estimating may occur by analyzing a second portion of the column. The system and method include generating the access plan to predict a characteristic of a set of results for the database query. In generating the access plan, the first statistical value for the column may be used.

## Claims

### Claim 1

A computer-implemented method of creating an access plan for a database query, the method comprising:
identifying a first portion of a column of a table of a database in a select statement of the database query;
estimating, by analyzing a second portion of the column, using an analytics engine, a first statistical value for the column, the estimating including:
receiving, by the analytics engine, data from the table of the database;
receiving, by the analytics engine, for natural language processing, a specific query related to data from the table of the database;
resolving, by the analytics engine, using natural language processing, the specific query, wherein resolving the specific query includes comparing a corpus and data from the table of the database; and
determining, by the analytics engine, in response to resolving the specific query, the first statistical value for the column; and
generating, using the first statistical value for the column, the access plan to predict a characteristic of a set of results for the database query.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first statistical value for the column includes cardinality for the column.

### Claim 3 (depends on 1)

The method of claim 1, wherein selectivity is either the first statistical value for the column or the characteristic of the set of results for the database query.

### Claim 4 (depends on 1)

The method of claim 1, wherein analyzing the second portion of the column includes comparing the second portion of the column to profile data, the second portion of the column includes a column header, and the characteristic of the set of results for the database query includes a number of rows.

### Claim 5 (depends on 1)

The method of claim 1, further comprising determining a statistics table is unsuitable for creating the access plan for the database query, wherein the statistics table is unsuitable in response to at least one of one of a group selected from an absence of the statistics table, an absence of records in the statistics table, reaching a threshold burden of computing resources used for accessing the statistics table, or a user choice to not utilize the statistics table.

### Claim 6 (depends on 1)

The method of claim 1, wherein analyzing the second portion of the column includes determining a measure of correlation of the column with another column of the table of the database that is persistently related to the column.

### Claim 7 (depends on 1)

The method of claim 1, wherein the database query includes a join, analyzing the second portion of the column includes classifying the second portion of the column into a category, and the characteristic of the set of results for the database query includes an expected join count related to the number of rows.

### Claim 8

A computer-implemented method of creating an access plan for a database query, the method comprising:
determining a statistics table is unsuitable for creating the access plan for the database query;
identifying a first portion of a column of a table of a database in a select statement of the database query;
estimating, by analyzing a second portion of the column, using an analytics engine, including a column header of the column, a cardinality value for the column, the estimating including:
receiving, by the analytics engine, data from the table of the database;
receiving, by the analytics engine, for natural language processing, a specific query related to data from the table of the database;
resolving, by the analytics engine, using natural language processing, the specific query, wherein resolving the specific query includes comparing a corpus and data from the table of the database; and
determining, by the analytics engine, in response to resolving the specific query, the cardinality value for the column; and
generating, using the cardinality value for the column, the access plan to predict a characteristic related to a number of rows of a set of results for the database query.

### Claim 9 (depends on 8)

The method of claim 8, wherein selectivity is the characteristic of the set of results for the database query.

### Claim 10 (depends on 8)

The method of claim 8, wherein the database query includes a join, analyzing the second portion of the column includes determining a measure of correlation of the column with another column of the table of the database that is permanently related to the column, and the characteristic related to a number of rows of the set of results for the database query includes an expected join count related to the number of rows.
