Range Partitioning

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: Range分区

| username: Ming

To improve efficiency, please provide the following information. A clear problem description can be resolved more quickly:
【TiDB Usage Environment】Production
【TiDB Version】5.4.1
【Encountered Problem】
v3.0.8 version
One of the columns in a table is of varchar(8) type, with output format like this: 2022-01
Creating a partition: PARTITION BY RANGE (month(concat(test, “-01”)) - 1)
Partitions by month based on the output result

v5.4.1 version
This partitioning method is not supported. How should it be modified to partition by months from 01 to 12?

| username: h5n1 | Original post link

How about trying range columns partitioning?

| username: Ming | Original post link

Creating Range Columns partitions like this results in an error, it seems like it wasn’t recognized. There doesn’t seem to be a detailed introduction to this partitioning in version 5.4.

| username: 近墨者zyl | Original post link

There is no way, change this column to a time column. Character fields can’t be handled like this, and each insertion requires conversion to time, which is not good for performance and will result in a lot of recursive calls.

| username: Ming | Original post link

Thank you.

| username: 近墨者zyl | Original post link

You’re welcome, let’s learn and progress together.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.