This topic describes the partitioning types and partitioning key types supported for routing by OceanBase Database Proxy (ODP).
Partitioning
OceanBase Database can split the data of a table into different groups based on some rules. Data in the same group is stored in the same physical area. This area is called a partition. A table split in this way is called a partitioned table. For more information about the partitioning types supported by OceanBase Database, see Overview in MySQL mode and Overview in Oracle mode.
ODP supports the following partitioning types:
RANGE partitioning
Note
When you create a RANGE-partitioned table, only the SUBSTR function can be used to delimit partitions. Other functions may lead to inaccurate routing.
KEY partitioning
LIST partitioning
HASH partitioning
Composite partitioning
Partitioning key
A partitioning key consists of one or more columns that determine how rows are stored in partitions of a table. Each row is assigned to a specified partition. OceanBase Database automatically directs insert, update, and delete operations to the corresponding partition by using the partitioning key.
ODP supports the following data types for partitioning keys:
Datetime data types: TIMESTAMP, DATE, and DATETIME
DOUBLE
Note
When you create a column or table, you cannot use
DOUBLE[(M,D)]to control the precision because it may lead to inaccurate routing.FLOAT
INT: INT8 to INT64
DECIMAL
String data types: CHAR and VARCHAR
Hexadecimal formats for partitioning key values:
x'<NUMBER_STR>',0x<NUMBER_STR>,X'<NUMBER_STR>', and0X<NUMBER_STR>