MySQL [dw_raw]> create table user_pay_test like user_pay;
Query OK, 0 rows affected (0.530 sec)
MySQL [dw_raw]> ALTER TABLE user_pay_test PARTITION BY RANGE COLUMNS (event_datetime) INTERVAL (1 MONTH) FIRST PARTITION LESS THAN ('2021-01-01') LAST PARTITION LESS THAN ('2030-01-01');
Query OK, 0 rows affected, 1 warning (48.037 sec)
MySQL [dw_raw]> create table user_pay_test2 like user_pay_test;
Query OK, 0 rows affected (1.691 sec)
MySQL [dw_raw]> show warnings;
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1105 | The statistics of new partitions will be outdated after reorganizing partitions. Please use 'ANALYZE TABLE' statement if you want to update it now |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.016 sec)
MySQL [dw_raw]> select version();
+--------------------+
| version() |
+--------------------+
| 8.0.11-TiDB-v7.5.1 |
+--------------------+
1 row in set (0.024 sec)
MySQL [dw_raw]> select @@global.tidb_gc_life_time;
+----------------------------+
| @@global.tidb_gc_life_time |
+----------------------------+
| 24h0m0s |
+----------------------------+
1 row in set (0.026 sec)