# US 2017/0293469 A1 · Efficient handling of sort payload in a column organized relational database

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

- Number: US 2017/0293469 A1
- Document ID: US20170293469A1
- Status: Published application
- Kind: A1
- Application number: 15/465,095
- Filed: 2017-03-21
- Published: 2017-10-12
- Earliest claimed: 2016-04-10
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Gopi K. ATTALURI; Vijayshankar RAMAN; David C. SHARPE
- Web page: https://patentgrep.com/patent/US20170293469A1

## CPC

- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 7/24: Sorting, i.e. extracting data from one or more carriers, rearranging the data in numerical or other ordered sequence, and rerecording the sorted data on the original carrier or on a different carrier or set of carriers {sorting methods in general}(G06F7/36 takes precedence)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A system for sorting in a column organized relational database by sorting only key columns in the column organized relational database to reduce memory and CPU usage. The sort may be performed using an in memory sort. After sorting the key columns, the system orders a payload column according to an order indicated by the key columns. The payload column is associated with the key columns in the column organized relational database. The system assesses memory capacity prior to ordering the payload column. Prior to ordering a plurality of payload columns, the system refrains from automatically concatenating the plurality of payload columns, and refrains from automatically de-concatenating any concatenated payload columns after the ordering the plurality of payload columns. The system determines an amount of required memory necessary to order the payload column, and detects an amount of available memory accessible to order the payload column.

## Claims

### Claim 1

A method for sorting in a column organized relational database, the method comprising:
sorting only key columns in the column organized relational database to reduce memory and CPU usage, wherein the sort may be performed using an in memory sort;
after sorting the key columns, ordering a payload column according to an order indicated by the key columns, wherein the payload column is associated with the key columns in the column organized relational database; and
assessing memory capacity prior to ordering the payload column.

### Claim 2 (depends on 1)

The method of claim 1 wherein ordering the payload column according to an order indicated by the key columns comprises:
prior to ordering a plurality of payload columns, refraining from automatically concatenating the plurality of payload columns; and
refraining from automatically de-concatenating any concatenated payload columns after the ordering the plurality of payload columns.

### Claim 3 (depends on 2)

The method of claim 2 wherein assessing memory capacity prior to ordering the payload column comprises:
determining an amount of required memory necessary to order the payload column; and
detecting an amount of available memory accessible to order the payload column.

### Claim 4 (depends on 3)

The method of claim 3 comprising:
determining the plurality of payload columns may be ordered concurrently based the required memory and the available memory.

### Claim 5 (depends on 4)

The method of claim 4 comprising:
detecting a plurality of agents each available to perform at least one of the sorting and the ordering; and
ordering the plurality of payload columns concurrently wherein each of the plurality of payload columns is ordered individually by at least one of the plurality of agents.

### Claim 6 (depends on 5)

The method of claim 5 further comprising:
determining a maximum parallelism for ordering the plurality of payload columns based on a column width of each of the plurality of payload columns, and a relative cost of performing the ordering.

### Claim 7 (depends on 4)

The method of claim 4 comprising:
assessing an amount of anticipated memory that will be accessible at a time during which the plurality of payload columns are ordered;
determining the plurality of payload columns that may be ordered concurrently based on the available memory; and
determining a sequence in which the plurality of payload columns may be ordered based on the anticipated memory.

### Claim 8 (depends on 3)

The method of claim 3 comprising:
determining the amount of required memory is greater than the amount of available memory; and
spilling to disk the ordering of the payload column using a spill sort to sort the key columns.

### Claim 9 (depends on 1)

The method of claim 1 wherein ordering a payload column according to an order indicated by the key columns comprises:
determining a consumption order in which a user will consume a plurality of payload columns; and
performing an ordering of each of the plurality of payload columns according to the consumption order.
