# US 9,519,662 B2 · Boolean term conversion for null-tolerant disjunctive predicates

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

- Number: US 9,519,662 B2
- Document ID: US9519662B2
- Status: Granted
- Kind: B2
- Application number: 14/022,322
- Filed: 2013-09-10
- Published: 2015-03-12
- Granted: 2016-12-13
- Earliest claimed: 2013-09-10
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Thomas A. Beavin; Mengchu Cai; Dengfeng Gao; Jae H. Lee; Li-Mey P. Lee; Terence P. Purcell; Shengxi Suo
- Web page: https://patentgrep.com/patent/US9519662B2

## CPC

- G06F 16/21: Design, administration or maintenance of databases
- G06F 16/24534: {Query rewriting; Transformation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

System, method, and computer program product to modify a received query, the received query including a first predicate specifying a comparison operator and a second predicate specifying an IS NULL operator, by replacing the comparison operator of the first predicate with an extended comparison operator, and removing the IS NULL operator from the received query, the extended comparison operator configured to support searching of NULL values in a database management system (DBMS), wherein the extended comparison operator is configured to return rows having column data matching a value predefined to represent NULL values.

## Claims

### Claim 1

A system, comprising:
one or more computer processors; and
a memory containing a program, which when executed by the one or more computer processors, performs an operation comprising:
determining that a received query comprises a first predicate specifying a comparison operator and a second predicate specifying an IS NULL operator;
modifying the received query, wherein modifying the received query comprises:
replacing the comparison operator of the first predicate with an extended comparison operator, wherein the extended comparison operator is not a NULL operator and returns column values having a value predefined to represent NULL values; and
removing the second predicate and the IS NULL operator from the received query; and
processing the modified query, wherein processing the modified query comprises:
searching a set of column values in a database management system (DBMS) satisfying the extended comparison operator of the first predicate; and
returning at least a first column value, of the set of column values, as responsive to the modified query, wherein the first column value satisfies the extended comparison operator of the first predicate by matching the value predefined to represent NULL values.

### Claim 2 (depends on 1)

The system of claim 1, wherein the modified query comprises a single comparison predicate, wherein the single comparison predicate comprises the extended comparison operator, wherein the value predefined to represent NULL values comprises one of: (i) a largest value capable of being stored in the column data, and (ii) a smallest value capable of being stored in the column data, the operation further comprising:
providing the extended comparison operator in the DBMS.

### Claim 3 (depends on 2)

The system of claim 2, the operation further comprising:
prior to modifying the received query, determining whether a NULL indicator of at least one row of column data specified in the received query indicates whether the column data is NULL, wherein the NULL indicator precedes the column data.

### Claim 4 (depends on 3)

The system of claim 3, wherein the received query is modified upon determining that the value predefined to represent NULL values would be returned by applying the extended comparison operator to the column data, the operation further comprising:
executing the modified query.

### Claim 5 (depends on 4)

The system of claim 4, wherein the value predefined to represent NULL values is the largest value capable of being stored in the column data, wherein searching the set of column values comprises identifying column values matching at least one of: (i) the value predefined to represent NULL values, (ii) a value between a specified value in the first predicate and the value predefined to represent NULL values, and (iii) the specified value in the first predicate, wherein the extended comparison operator comprises each individual extended operator selected from the group comprising: (i) an extended greater than operator, (ii) an extended equals operator, and (iii) an extended greater than or equals operator.

### Claim 6 (depends on 4)

The system of claim 4, wherein the value predefined to represent NULL values is the smallest value capable of being stored in the column data, wherein searching the set of column values comprises identifying column values matching at least one of: (i) the value predefined to represent NULL values, (ii) a value between the value predefined to represent NULL values and a specified value in the first predicate, and (iii) the specified value in the first predicate, wherein the extended comparison operator comprises each individual extended operator selected from the group comprising: (i) an extended less than operator, (ii) an extended equals operator, and (iii) an extended less than or equals operator.

### Claim 7 (depends on 6)

The system of claim 6, wherein the extended comparison operator comprises an IN list predicate that is augmented to be NULL-tolerant.

### Claim 8 (depends on 1)

The system of claim 1, wherein searching the set of column values comprises identifying column values matching the value predefined to represent NULL values.

### Claim 9

A computer program product, comprising:
a non-transitory computer-readable storage medium having computer-readable program code embodied therewith, the computer-readable program code executable by a processor to perform an operation comprising:
determining that a received query comprises a first predicate specifying a comparison operator and a second predicate specifying an IS NULL operator;
modifying the received query, wherein modifying the received query comprises:
replacing the comparison operator of the first predicate with an extended comparison operator, wherein the extended comparison operator is not a NULL operator and returns column values having a value predefined to represent NULL values; and
removing the second predicate and the IS NULL operator from the received query; and
processing the modified query, wherein processing the modified query comprises:
searching a set of column values in a database management system (DBMS) satisfying the extended comparison operator of the first predicate; and
returning at least a first column value, of the set of column values, as responsive to the modified query, wherein the first column value satisfies the extended comparison operator of the first predicate by matching the value predefined to represent NULL values.

### Claim 10 (depends on 9)

The computer program product of claim 9, wherein the modified query comprises a single comparison predicate, wherein the single comparison predicate comprises the extended comparison operator, wherein the value predefined to represent NULL values comprises one of: (i) a largest value capable of being stored in the column data, and (ii) a smallest value capable of being stored in the column data, the operation further comprising:
providing the extended comparison operator in the DBMS.

### Claim 11 (depends on 10)

The computer program product of claim 10, the operation further comprising:
prior to modifying the received query, determining whether a NULL indicator of at least one row of column data specified in the received query indicates whether the column data is NULL, wherein the NULL indicator precedes the column data.

### Claim 12 (depends on 11)

The computer program product of claim 11, wherein the received query is modified upon determining that the value predefined to represent NULL values would be returned by applying the extended comparison operator to the column data, the operation further comprising:
executing the modified query.

### Claim 13 (depends on 12)

The computer program product of claim 12, wherein the value predefined to represent NULL values is the largest value capable of being stored in the column data, wherein searching the set of column values comprises identifying column values matching at least one of: (i) the value predefined to represent NULL values, (ii) a value between a specified value in the first predicate and the value predefined to represent NULL values, and (iii) the specified value in the first predicate, wherein the extended comparison operator comprises each individual extended operator selected from the group comprising: (i) an extended greater than operator, (ii) an extended equals operator, and (iii) an extended greater than or equals operator.

### Claim 14 (depends on 12)

The computer program product of claim 12, wherein the value predefined to represent NULL values is the smallest value capable of being stored in the column data, wherein searching the set of column values comprises identifying column values matching at least one of: (i) the value predefined to represent NULL values, (ii) a value between the value predefined to represent NULL values and a specified value in the first predicate, and (iii) the specified value in the first predicate, wherein the extended comparison operator comprises each individual extended operator selected from the group comprising: (i) an extended less than operator, (ii) an extended equals operator, and (iii) an extended less than or equals operator.

### Claim 15 (depends on 9)

The computer program product of claim 9, wherein searching the set of column values comprises identifying column values matching the value predefined to represent NULL values.
