# Partitioned Table

+ Currently supported partition types include Range partitions, List partitions, List COLUMNS partitions, and Hash partitions
+ Range partitions, List partitions, and List COLUMNS partitions can be used to solve performance problems caused by a large number of deletions in the business
+ Hash partitions can be used for data fragmentation in scenario where there is a large number of writes
+ Each unique key or primary key of a partitioned table must contain all the columns used in the partition expression
+ Valid partitioned table and invalid partitioned table:
```
CREATE TABLE t1 (
    col1 INT NOT NULL,
    col2 DATE NOT NULL,
    col3 INT NOT NULL,
    col4 INT NOT NULL,
    UNIQUE KEY (col1, col2, col3)
)
PARTITION BY HASH(col3)
PARTITIONS 4;

CREATE TABLE t1 (
    col1 INT NOT NULL,
    col2 DATE NOT NULL,
    col3 INT NOT NULL,
    col4 INT NOT NULL,
    UNIQUE KEY (col1, col2)
)
PARTITION BY HASH(col3)
PARTITIONS 4;
```
------------------------------------------------------------
partitioned table 
Currently supported types include Range partitions, List partitions, List COLUMNS partitions, and Hash partitions
- The Range partition, List partition, and List COLUMNS partition can be used to solve the performance problems caused by a large number of deletes in the business, and supports fast deletion of partitions.
- Hash partitions can be used for data fragmentation in scenario where a large number of writes are made.
- Each unique key or primary key of a partitioned table must contain all of the columns used in the partition expression
  - Invalid partition table
CREATE TABLE t1 (
    col1 int NOT NULL,
    col2 DATE NOT NULL,
    col3 int NOT NULL,
    col4 int NOT NULL,
    UNIQUE KEY (col1, col2)
)
PARTITION BY HASH (col3)
Partitions 4;

CREATE TABLE t1 (
    col1 int NOT NULL,
    col2 DATE NOT NULL,
    col3 int NOT NULL,
    col4 int NOT NULL,
    UNIQUE KEY (col1, col2, col3)
)
PARTITION BY HASH (col3)
Partitions 4;
