IP Library Granted Patent US 11,204,905
Granted Patent B2
US 11,204,905 · App. 16/020,936 · Granted Dec 21, 2021

Trie-based indices for databases

Inventor: Branimir Zdravkov Lambov (Nesebar, BG)
Assignee: DataStax, Inc.
G06F16/2246G06F16/2255
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,204,905
App. No.
16/020,936
Granted
Dec 21, 2021
Kind
B2
Abstract

A database system uses byte ordering for keys and a trie index to reference stored data. The keys of a database are converted into byte-comparable sequences of byte values. The trie index is generated including nodes connected by edges defining paths from a root node to leaf nodes. Each edge is associated with at least one byte value such that each path from the root node to a leaf node through one or more edges defines a unique byte prefix for a byte-comparable sequence of byte values. The leaf node of each path is associated with a database location value. A record is accessed in the database using a database location value determined from referencing the trie index using a byte-comparable sequence of byte values of the record generated from a key of the record. A trie structure and byte ordered keys may be used for partition or row indices.

Claims (56)

1. A method, comprising:

converting keys of a database into byte-comparable sequences of byte values, the keys including non-byte-comparable data types that are converted into byte values such that byte order is available for the non-byte-comparable data types;

generating a trie index for the database, the trie index including nodes connected by edges defining paths from a root node to leaf nodes, each edge being associated with at least one byte value such that each path from the root node to a leaf node through one or more edges defines a unique byte prefix for a byte-comparable sequence of byte values of the byte-comparable sequences of byte values, wherein the trie index is a partition index with database location values including references to trie row indices of partitions;

converting a key for a record into a byte-comparable sequence of byte values, wherein:

the key for the record includes a partition key and a clustering key;

converting the key includes converting the partition key into a first portion of the byte-comparable sequence of byte values and converting the clustering key into a second portion of the byte-comparable sequence of byte values; and

referencing the trie index using the first portion of the byte-comparable sequence of byte values to identify a trie row index of a partition; and

accessing the record in a row of the partition by referencing the trie row index using the second portion of the byte-comparable sequence of byte values.

2. The method of claim 1 , wherein referencing the trie index with the first portion of the byte-comparable sequence of byte values includes:

traversing the trie index from the root node to a first leaf node according to a first unique byte prefix of the first portion of the byte-comparable sequence of byte values; and

determining the trie row index from the first leaf node.

3. The method of claim 1 , further comprising:

converting another key for another record into another byte-comparable sequence of byte values;

determining whether the trie index includes a path from the root node to a leaf node for another unique byte prefix of the other byte-comparable sequence of byte values; and

determining that the other record is not in the database responsive to determining that the trie index fails to include the path for the other unique byte prefix of the other byte-comparable sequence of byte values.

4. The method of claim 1 , further comprising storing the trie index in a memory, the nodes of the trie index being stored in the memory using node types, each node having a node type based on a number of child nodes of the node and a pointer size associated with the child nodes of the node.

5. The method of claim 1 , further comprising storing the trie index in disk pages in a page-packed manner.

6. The method of claim 1 , further comprising storing the trie index in disk pages using a bottom-up packing process.

7. The method of claim 1 , wherein each leaf node of the trie index includes a hash value.

8. The method of claim 1 , wherein accessing the record in the row of the partition by referencing the trie row index includes iteration in a forward or reverse direction using the second portion of the byte-comparable sequence of byte values.

9. The method of claim 1 , further comprising generating the trie row index by:

forming blocks from rows of the records in the partition;

in each block, converting an initial key of the block into an initial byte-comparable sequence of byte values and a final key of the block into a final byte-comparable sequence of byte values; and

for each consecutive pair of blocks, determining separator byte prefixes that are larger than the final byte-comparable sequence of byte values of a preceding block and smaller than the initial byte-comparable sequence of byte values of a succeeding block; and

generating the trie row index for the partition mapping the separator byte prefixes to positions in the partition between the blocks.

10. A system, comprising:

a database; and

processing circuitry, configured to:

convert keys of the database into byte-comparable sequences of byte values, the keys including non-byte-comparable data types that are converted into byte values such that byte order is available for the non-byte-comparable data types;

generate a trie index for the database, the trie index including nodes connected by edges defining paths from a root node to leaf nodes, each edge being associated with at least one byte value such that each path from the root node to a leaf node through one or more edges defines a unique byte prefix for a byte-comparable sequence of byte values of the byte-comparable sequences of byte values, wherein the trie index is a partition index with database location values including references to trie row indices of partitions;

convert a key for a record into a byte-comparable sequence of byte values, wherein:

the key for the record includes a partition key and a clustering key;

the partition key is converted into a first portion of the byte-comparable sequence of byte values and the clustering key is converted into a second portion of the byte-comparable sequence of byte values;

reference the trie index using the first portion of the byte-comparable sequence to identify a trie row index of a partition; and

access the record in a row of the partition by referencing the trie row index using the second portion of the byte-comparable sequence of byte values.

11. The system of claim 10 , wherein the processing circuitry configured to reference the trie index with the first portion of the byte-comparable sequence of byte values includes the processing circuitry being configured to:

traverse the trie index from the root node to a first leaf node according to a first unique byte prefix of the first portion of the byte-comparable sequence of byte values; and

determine the trie row index from the first leaf node.

12. The system of claim 10 , wherein the processing circuitry is further configured to store the nodes of the trie index in a memory using node types, each node using a node type based on a number of child nodes of the node and a pointer size associated with the child nodes of the node.

13. The system of claim 10 , wherein the processing circuitry is further configured to store the trie index in disk pages in a page-packed manner.

14. The system of claim 10 , wherein the processing circuitry is further configured to store the trie index in disk pages using a bottom-up packing process.

15. The system of claim 10 , wherein each leaf node of the trie index includes a hash value.

16. The system of claim 10 , wherein the processing circuitry is further configured to generate the trie row index by:

form blocks from rows of the records in the partition;

in each block, convert an initial key of the block into an initial byte-comparable sequence of byte values and a final key of the block into a final byte-comparable sequence of byte values; and

for each consecutive pair of blocks, determine separator byte prefixes that are larger than the final byte-comparable sequence of byte values of a preceding block and smaller than the initial byte-comparable sequence of byte values of a succeeding block; and

generate the trie row index for the partition mapping the separator byte prefixes to positions in the partition between the blocks.

17. The system of claim 10 , wherein accessing the record in the row of the partition by referencing the trie row index includes iteration in a forward or reverse direction using the second portion of the byte-comparable sequence of byte values.

18. A non-transitory computer readable medium storing instructions that when executed by a processor causes the processor to:

convert keys of a database into byte-comparable sequences of byte values, the keys including non-byte-comparable data types that are converted into byte values such that byte order is available for the non-byte-comparable data types;

generate a trie index for the database, the trie index including nodes connected by edges defining paths from a root node to leaf nodes, each edge being associated with at least one byte value such that each path from the root node to a leaf node through one or more edges defines a unique byte prefix for a byte-comparable sequence of byte values of the byte-comparable sequences of byte values, wherein the trie index is a partition index with database location values including references to trie row indices of partitions;

convert a key for a record into a byte-comparable sequence of byte values, wherein:

the key for the record includes a partition key and a clustering key;

the partition key is converted into a first portion of the byte-comparable sequence of byte values and the clustering key is converted into a second portion of the byte-comparable sequence of byte values;

reference the trie index using the first portion of the byte-comparable sequence of byte values to identify a trie row index of a partition; and

access the record in a row of the partition by referencing the trie row index using the second portion of the byte-comparable sequence of byte values.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 9, 2025
From: DATASTAX, INC.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 072198/0047 →
RELEASE OF SECURITY INTEREST Recorded Aug 14, 2025
From: FIRST-CITIZENS BANK & TRUST COMPANY (AS SUCCESSOR TO SILICON VALLEY BANK)
To: DATASTAX, INC.
Reel/Frame 073504/0484 →
SUPPLEMENT TO INTELLECTUAL PROPERTY SECURITY AGREEMENT Recorded Feb 20, 2020
From: DATASTAX, INC.
To: SILICON VALLEY BANK
Reel/Frame 051985/0492 →
CORRECTIVE ASSIGNMENT TO CORRECT THE EXHIBIT B PATENT APPLICATION NUMBER 16/202,936 PREVIOUSLY RECORDED ON REEL 049601 FRAME 0124. ASSIGNOR(S) HEREBY CONFIRMS THE INTELLECTUAL PROPERTY SECURITY AGREEMENT. Recorded Feb 20, 2020
From: DATASTAX, INC.
To: SILICON VALLEY BANK
Reel/Frame 052392/0260 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 28, 2018
From: LAMBOV, BRANIMIR ZDRAVKOV
To: DATASTAX, INC.
Reel/Frame 046232/0054 →
Cited By (1)
US 12,598,135