Create indices

This commit is contained in:
ekzyis 2025-01-29 12:43:27 +01:00
parent 6c8b9ace28
commit f12f3e5019

View File

@ -11,6 +11,7 @@ CREATE TABLE host_uptime (
-- uptime in seconds
uptime INT NOT NULL
);
CREATE INDEX host_uptime_host_id_created_at_idx ON host_uptime(host_id, created_at);
CREATE TABLE host_mem (
id SERIAL PRIMARY KEY,
@ -19,6 +20,7 @@ CREATE TABLE host_mem (
-- available memory in kB
mem_avail INT NOT NULL
);
CREATE INDEX host_mem_host_id_created_at_idx ON host_mem(host_id, created_at);
CREATE TABLE host_disk (
id SERIAL PRIMARY KEY,
@ -27,6 +29,7 @@ CREATE TABLE host_disk (
-- free disk space in kB
disk_free INT NOT NULL
);
CREATE INDEX host_disk_host_id_created_at_idx ON host_disk(host_id, created_at);
CREATE TABLE host_cpu (
id SERIAL PRIMARY KEY,
@ -35,3 +38,4 @@ CREATE TABLE host_cpu (
-- cpu load for last minute
cpu_load_1m FLOAT NOT NULL
);
CREATE INDEX host_cpu_host_id_created_at_idx ON host_cpu(host_id, created_at);