# Partitioning Types

+ **`RANGE`** is based on ranges of values in the specified integer-typed column
+ **`LIST`** is based on the discrete set of values in the specified integer-typed column
+ **`HASH`** is based on the modulus operation on the specified integer-typed column
+ **`KEY`** is based on the hash function in the specified column
+ Variants from base types: **`RANGE COLUMNS`**, **`RANGE INTERVAL`**, **`LIST COLUMNS`**, **`LINEAR HASH`**, and **`LINEAR KEY`**

------------------------------------------------------------------------------
`RANGE` is based on ranges of values in the specified column.

`LIST` is based on the discrete set of values in the specified column. 

Both `KEY` partitioning and `HASH` partitioning can evenly distribute data into a certain number of partitions. The difference is that `HASH` partitioning only supports distributing data based on a specified integer expression or an integer column, while `KEY` partitioning supports distributing data based on a column list, and partitioning columns of `KEY` partitioning are not limited to the integer type. The hash algorithm of TiDB for Key partitioning is different from that of MySQL, so the table data distribution is also different.

The `RANGE COLUMNS` and `LIST COLUMNS` partitioning types enable the use of multiple columns in the partitioning key.

In MySQL, the `LINEAR HASH` and `LINEAR KEY` partitioning types employ distinct row distribution algorithms compared to those used in `HASH` and `KEY` partitioning. 

In TiDB, starting from v6.4.0, TiDB disregards the `LINEAR` keyword and creates a `HASH` partitioned table with a warning. Starting from v7.0.0, TiDB is capable of parsing the MySQL `LINEAR KEY` syntax for `KEY` partitioning. However, TiDB does not consider the `LINEAR` keyword and instead utilizes a non-linear hash algorithm.

