Unlock instant, AI-driven research and patent intelligence for your innovation.

Partition table establishment, data writing and reading method and device for partition table

A technique for establishing a method and a partition table, applied in the field of database

Active Publication Date: 2022-07-05
BEIJING OCEANBASE TECH CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, there are some non-primary key tables in the database. For the data in the non-primary key tables, how to implement storage based on LSM-tree becomes a problem to be solved

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Partition table establishment, data writing and reading method and device for partition table
  • Partition table establishment, data writing and reading method and device for partition table
  • Partition table establishment, data writing and reading method and device for partition table

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0045] The solution provided in this specification will be described below with reference to the accompanying drawings.

[0046] At present, the storage architecture adopted by traditional databases usually does not require data tables to have primary keys. The index table of the data table records the index column and the row identifier (ROWID) of the data row. However, after partition splitting, partition merging, and partition swapping are performed on the data table, the row identifier of the data row will change, which makes the index table invalid and needs to be rebuilt.

[0047] In MySQL InnoDB, for tables without primary keys, a table-level auto-increment column is usually added as a hidden primary key. However, when swapping partitions for tables without a primary key (usually between two tables), there may be issues of primary key conflict (or non-uniqueness) within the table, requiring data rewriting. It can be seen that this method of adding a hidden primary key...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiments of this specification provide a method and device for creating a partition table, writing and reading data for a partition table, and in the method for creating a partition table, a first table creation instruction is received, which at least includes the information of the first partition table to be created. Attribute columns and partition rules. The first partition table is a table without a primary key, and the partition rule at least indicates the partition key and the first number of partitions based on which data rows to be written in the first partition table are divided into logical partitions. A first partition table is created based on each attribute column, and a first number of corresponding logical partitions and a physical partition corresponding to each logical partition are created according to the partitioning rule, and the physical partition has a globally unique partition identifier. A synthetic primary key is added to the first partition table as a hidden primary key, where the synthetic primary key is composed of a partition identifier of a physical partition and a partition-level self-increasing identifier.

Description

technical field [0001] One or more embodiments of this specification relate to the field of databases, and in particular, to a method and apparatus for establishing a partition table, and writing and reading data for a partition table. Background technique [0002] At present, many modern databases store data through a log-structured merge tree (The Log-Structured-MergeTree, LSM-tree). In the storage architecture of LSM-tree, data is organized in the form of key-value (Key-Value) pairs, where the key (Key) is usually taken from the primary key of the data table. However, there are many non-primary key tables in the database. For the data in the non-primary key table, how to implement storage based on LSM-tree becomes a problem to be solved. SUMMARY OF THE INVENTION [0003] One or more embodiments of this specification describe a method and apparatus for establishing a partition table, writing and reading data for a partition table, which can generate an effective primary...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/22
CPCG06F16/2282G06F16/2246
Inventor 杨佳伟谢振江赵裕众孙坚运李洪嵚刘基雄
Owner BEIJING OCEANBASE TECH CO LTD