defaultstoragegroups系统表说明

描述

This table contains table partition to storage group mappings created with the 地图分区 statement.

领域

场地 类型 描述

partitionName.

细绳

The name of the table partition mapped to the storage group specified in the 存储群 column by the 地图分区 statement.

存储群

细绳

The name of the storage group to which the table partition in the partitionName. column is mapped by the 地图分区 statement. This is the storage group for this partition, if no STORE IN clause is specified for the CREATE or 改变表 command.

索引

Primary Index: DEFAULTSTORAGEGROUPS..PRIMARY_KEY on field: partitionName.

例子

In the example below, we map partition p_east to storage group sgeast and partition p_west to storage group sgwest. This means, by default, if you do not specify STORE IN, then data inserted into partition p_east will be stored in storage group sgeast and data inserted into partition p_west will be stored in sgwest.

MAP PARTITION p_east STORE IN sgeast;
MAP PARTITION p_west STORE IN sgwest;
选择 * FROM system.defaultstoragegroups;

 PARTITIONNAME  STORAGEGROUP
 -------------- -------------

     P_EAST        SGEAST
     P_WEST        SGWEST

CREATE DOMAIN zipcode CHAR(5);
CREATE TABLE users (first STRING, last STRING, zip zipcode)
    PARTITION BY RANGE (zip)
        PARTITION p_east VALUES LESS THAN ('70000')
        PARTITION p_west VALUES LESS THAN (maxvalue);