添加分区子表
 
                  更新时间 2025-02-14 10:21:40
                 
 
                    最近更新时间: 2025-02-14 10:21:40
                  
 本文为您介绍如何添加分区子表。
 teledb=# \d+ t_range
Table "public.t_range"
Column |            Type             | Collation | Nullable | Default | Storage | Stats target | Description 
--------+-----------------------------+-----------+----------+---------+---------+--------------+-------------
f1     | bigint                      |           |          |         | plain   |              | 
f2     | timestamp without time zone |           |          | now()   | plain   |              | 
f3     | integer                     |           |          |         | plain   |              | 
Distribute By: SHARD(f1)
Location Nodes: ALL DATANODES
Partition By: RANGE(f3)
 # Of Partitions: 3
 Start With: 1
 Interval Of Partition: 50
teledb=# alter table t_range add partitions 2;
ALTER TABLE
teledb=# \d+ t_range
Table "public.t_range"
Column |            Type             | Collation | Nullable | Default | Storage | Stats target | Description 
--------+-----------------------------+-----------+----------+---------+---------+--------------+-------------
f1     | bigint                      |           |          |         | plain   |              | 
f2     | timestamp without time zone |           |          | now()   | plain   |              | 
f3     | integer                     |           |          |         | plain   |              | 
Distribute By: SHARD(f1)
Location Nodes: ALL DATANODES
Partition By: RANGE(f3)
 # Of Partitions: 5
 Start With: 1
 Interval Of Partition: 50