-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.2.sql
More file actions
24 lines (21 loc) · 691 Bytes
/
2.2.sql
File metadata and controls
24 lines (21 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Create a Time Series Schema */
CREATE SCHEMA time_series
AUTHORIZATION postgres;
/* Create a table of location and temperature measurements */
CREATE TABLE time_series.location_temp
(
event_time timestamp without time zone NOT NULL,
temp_celcius integer,
location_id character varying COLLATE pg_catalog."default"
);
ALTER TABLE time_series.location_temp OWNER to postgres;
/* Create table of server monitoring metrics */
CREATE TABLE time_series.utilization
(
event_time timestamp without time zone NOT NULL,
server_id integer NOT NULL,
cpu_utilization real,
free_memory real,
session_cnt integer,
CONSTRAINT utilization_pkey PRIMARY KEY (event_time, server_id)
);