-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.postgresql
65 lines (60 loc) · 1.39 KB
/
schema.postgresql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CREATE TABLE bd_rx_log
(sensor_id int,
ip inet,
timestamp timestamp with time zone DEFAULT now(),
sample_duration int,
total int,
icmp int,
udp int,
tcp int,
ftp int,
http int,
p2p int);
create index bd_rx_log_sensor_id_ip_timestamp_idx on bd_rx_log (sensor_id, ip, timestamp);
create index bd_rx_log_sensor_id_timestamp_idx on bd_rx_log(sensor_id, timestamp);
CREATE TABLE bd_tx_log
(sensor_id int,
ip inet,
timestamp timestamp with time zone DEFAULT now(),
sample_duration int,
total int,
icmp int,
udp int,
tcp int,
ftp int,
http int,
p2p int);
create index bd_tx_log_sensor_id_ip_timestamp_idx on bd_tx_log (sensor_id, ip, timestamp);
create index bd_tx_log_sensor_id_timestamp_idx on bd_tx_log(sensor_id, timestamp);
CREATE TABLE bd_rx_total_log
(sensor_id int,
ip inet,
timestamp timestamp with time zone DEFAULT now(),
sample_duration int,
total int,
icmp int,
udp int,
tcp int,
ftp int,
http int,
p2p int);
create index bd_rx_total_log_sensor_id_timestamp_ip_idx on bd_rx_total_log (sensor_id, timestamp);
CREATE TABLE bd_tx_total_log
(sensor_id int,
ip inet,
timestamp timestamp with time zone DEFAULT now(),
sample_duration int,
total int,
icmp int,
udp int,
tcp int,
ftp int,
http int,
p2p int);
create index bd_tx_total_log_sensor_id_timestamp_ip_idx on bd_tx_total_log (sensor_id, timestamp);
CREATE TABLE sensors
(
sensor_id serial PRIMARY KEY,
sensor_name varchar,
last_connection timestamp with time zone
);