数据仓库服务 GAUSSDB(DWS)-CREATE TABLE:示例

时间:2024-07-13 11:25:01

示例

创建简单的时序表:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
CREATE TABLE IF NOT EXISTS CPU(
scope_name text TSTag,
server_ip text TSTag,
group_path text TSTag,
time timestamptz TSTime,
 idle numeric TSField,
system numeric TSField,
 util numeric TSField,
vcpu_num numeric TSField,
guest numeric TSField,
iowait numeric TSField,
 users numeric TSField) with (orientation=TIMESERIES) distribute by hash(scope_name);

CREATE TABLE CPU1(
idle numeric TSField,
IO numeric TSField,
scope text TSTag,
IP text TSTag,
time timestamp TSTime
) with (TTL='7 days', PERIOD='1 day', orientation=TIMESERIES);

CREATE TABLE CPU2 (LIKE CPU INCLUDING ALL);
support.huaweicloud.com/IoT-devg-dws/dws_14_00003.html