# US 2021/0081428 A1 · Techniques for in-memory spatial object filtering

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

- Number: US 2021/0081428 A1
- Document ID: US20210081428A1
- Status: Published application
- Kind: A1
- Application number: 16/904,392
- Filed: 2020-06-17
- Published: 2021-03-18
- Earliest claimed: 2019-09-13
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Siva Ravada; Ying Hu; Zhen Hua Liu; Shasank Kisan Chavan; Aurosish Mishra; Vikas Arora
- Web page: https://patentgrep.com/patent/US20210081428A1

## CPC

- G06F 16/2452: Query translation
- G06F 16/252: {between a Database Management System and a front-end application}
- G06F 9/3887: {controlled by a single instruction for multiple data lanes [SIMD]}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/2425: {Iterative querying; Query formulation based on the results of a preceding query}
- G06F 16/24575: {using context}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are introduced herein for maintaining geometry-type data on persistent storage and in memory. Specifically, a DBMS that maintains a database table, which includes at least one column storing spatial data objects (SDOs), also maintains metadata for the database table that includes definition data for one or more virtual columns of the table. According to an embodiment, the definition data includes one or more expressions that calculate minimum bounding box values for SDOs stored in the geometry-type column in the table. The one or more expressions in the metadata maintained for the table are used to create one or more in-memory columns that materialize the bounding box data for the represented SDOs. When a query that uses spatial-type operators to perform spatial filtering over data in the geometry-type column is received, the DBMS replaces the spatial-type operators with operators that operate over the scalar bounding box information materialized in memory.

## Claims

### Claim 1

A computer-executed method comprising:
maintaining, on disk by a database management system, a first table that stores a plurality of columns that comprises one or more geometry-type columns;
wherein the database management system maintains metadata defining the plurality of columns;
wherein said metadata includes a definition of one or more virtual columns of said plurality of columns;
wherein the definition comprises one or more expressions that derive values for the one or more virtual columns from the one or more geometry-type columns;
creating a set of in-memory columns that materializes results of the one or more expressions based on the one or more geometry-type columns;
compiling, by the database management system, a query that includes a particular operator that operates on the one or more geometry-type columns;
wherein said compiling comprises rewriting the query to generate a rewritten query that includes at least one expression of the one or more expressions;
executing the rewritten query, wherein said executing the rewritten query comprises:
detecting the at least one expression in the rewritten query,
based on said detecting the at least one expression in the rewritten query, performing one or more tasks, required by the particular operator, based on the set of in-memory columns, and
returning a result data set;
wherein the method is performed by one or more computing devices.

### Claim 2 (depends on 1)

The computer-executed method of claim 1, wherein rewriting the query to generate a rewritten query that includes at least one expression of the one or more expressions is performed in response to determining that the first table is represented, in memory, at least in part by the set of in-memory columns.

### Claim 3 (depends on 1)

The computer-executed method of claim 1, wherein rewriting the query to generate the rewritten query comprises replacing, in the rewritten query, the particular operator with the at least one expression.

### Claim 4 (depends on 1)

The computer-executed method of claim 1, wherein creating the set of in-memory columns that materializes results of the one or more expressions comprises computing the one or more expressions for one or more spatial data objects stored in the one or more geometry-type columns.

### Claim 5 (depends on 1)

The computer-executed method of claim 1, wherein:
the one or more geometry-type columns include information defining a particular geometry;
the one or more expressions derive a set of bounding box values from the information defining the particular geometry; and
the set of bounding box values define a bounding box for the particular geometry.

### Claim 6 (depends on 5)

The computer-executed method of claim 5, wherein the set of in-memory columns store the set of bounding box values.

### Claim 7 (depends on 1)

The computer-executed method of claim 1, wherein the one or more virtual columns are not materialized on disk.

### Claim 8 (depends on 1)

The computer-executed method of claim 1, wherein the set of in-memory columns are materialized, in memory, in one or more in-memory expression units (IMEUs).

### Claim 9 (depends on 1)

The computer-executed method of claim 1, further comprising:
maintaining, in memory, a copy of data from the one or more geometry-type columns in a mirror format;
wherein the copy of data from the one or more geometry-type columns is associated with the set of in-memory columns that materializes results of the one or more expressions.

### Claim 10 (depends on 1)

The computer-executed method of claim 1, wherein the particular operator is of type SDO_filter.

### Claim 11 (depends on 1)

The computer-executed method of claim 1, wherein the one or more tasks comprise a Single Instruction, Multiple Data (SIMD) scan on at least a portion of the set of in-memory columns.

### Claim 12 (depends on 1)

The computer-executed method of claim 1, wherein:
said performing the one or more tasks based on the set of in-memory columns comprises identifying, based on information in the set of in-memory columns, a set of candidate geometry objects stored in the one or more geometry-type columns;
the method further comprises:
determining whether one or more geometry objects, of the set of candidate geometry objects, satisfy a requirement of the rewritten query, and
in response to determining that the one or more geometry objects satisfy the requirement of the rewritten query, generating the result data set based, at least in part, on the one or more geometry objects.

### Claim 13 (depends on 1)

The computer-executed method of claim 1, further comprising:
compiling, by the database management system, a second query that includes a second operator that operates on the one or more geometry-type columns;
wherein said compiling comprises rewriting the second query to generate a second rewritten query that includes a particular expression of the one or more expressions;
executing the second rewritten query, wherein said executing the second rewritten query comprises:
determining that results of the particular expression in the second rewritten query are not included in memory,
based on said determining that results of the particular expression in the second rewritten query are not included in memory, performing one or more tasks, required by the second operator, based on the one or more geometry-type columns, and
returning a second result data set.

### Claim 14

One or more non-transitory computer-readable media storing one or more sequences of instructions that, when executed by one or more processors, cause:
maintaining, on disk by a database management system, a first table that stores a plurality of columns that comprises one or more geometry-type columns;
wherein the database management system maintains metadata defining the plurality of columns;
wherein said metadata includes a definition of one or more virtual columns of said plurality of columns;
wherein the definition comprises one or more expressions that derive values for the one or more virtual columns from the one or more geometry-type columns;
creating a set of in-memory columns that materializes results of the one or more expressions based on the one or more geometry-type columns;
compiling, by the database management system, a query that includes a particular operator that operates on the one or more geometry-type columns;
wherein said compiling comprises rewriting the query to generate a rewritten query that includes at least one expression of the one or more expressions;
executing the rewritten query, wherein said executing the rewritten query comprises:
detecting the at least one expression in the rewritten query,
based on said detecting the at least one expression in the rewritten query, performing one or more tasks, required by the particular operator, based on the set of in-memory columns, and
returning a result data set.

### Claim 15 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein rewriting the query to generate a rewritten query that includes at least one expression of the one or more expressions is performed in response to determining that the first table is represented, in memory, at least in part by the set of in-memory columns.

### Claim 16 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein rewriting the query to generate the rewritten query comprises replacing, in the rewritten query, the particular operator with the at least one expression.

### Claim 17 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein creating the set of in-memory columns that materializes results of the one or more expressions comprises computing the one or more expressions for one or more spatial data objects stored in the one or more geometry-type columns.

### Claim 18 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein:
the one or more geometry-type columns include information defining a particular geometry;
the one or more expressions derive a set of bounding box values from the information defining the particular geometry; and
the set of bounding box values define a bounding box for the particular geometry.

### Claim 19 (depends on 18)

The one or more non-transitory computer-readable media of claim 18, wherein the set of in-memory columns store the set of bounding box values.

### Claim 20 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein the one or more virtual columns are not materialized on disk.

### Claim 21 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein the set of in-memory columns are materialized, in memory, in one or more in-memory expression units (IMEUs).

### Claim 22 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein the one or more sequences of instructions further comprise instructions that, when executed by one or more processors, cause:
maintaining, in memory, a copy of data from the one or more geometry-type columns in a mirror format;
wherein the copy of data from the one or more geometry-type columns is associated with the set of in-memory columns that materializes the one or more virtual columns.

### Claim 23 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein the particular operator is of type SDO_filter.

### Claim 24 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein the one or more tasks comprise a Single Instruction, Multiple Data (SIMD) scan on at least a portion of the set of in-memory columns.

### Claim 25 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein:
said performing the one or more tasks based on the set of in-memory columns comprises identifying, based on information in the set of in-memory columns, a set of candidate geometry objects stored in the one or more geometry-type columns;
the one or more sequences of instructions further comprise instructions that, when executed by one or more processors, cause:
determining whether one or more geometry objects, of the set of candidate geometry objects, satisfy a requirement of the rewritten query, and
in response to determining that the one or more geometry objects satisfy the requirement of the rewritten query, generating the result data set based, at least in part, on the one or more geometry objects.

### Claim 26 (depends on 14)

The one or more non-transitory computer-readable media of claim 14, wherein the one or more sequences of instructions further comprise instructions that, when executed by one or more processors, cause:
compiling, by the database management system, a second query that includes a second operator that operates on the one or more geometry-type columns;
wherein said compiling comprises rewriting the second query to generate a second rewritten query that includes a particular expression of the one or more expressions;
executing the second rewritten query, wherein said executing the second rewritten query comprises:
determining that results of the particular expression in the second rewritten query are not included in memory,
based on said determining that results of the particular expression in the second rewritten query are not included in memory, performing one or more tasks, required by the second operator, based on the one or more geometry-type columns, and
returning a second result data set.
