timescaledb/scripts/sql/setup_sample_hypertable.psql
Matvey Arye d3a3670aa6 Merged in install-nits (pull request #71)
nit to installation/docker
2017-01-31 22:03:14 +00:00

12 lines
327 B
Plaintext

CREATE TABLE conditions (
time BIGINT NOT NULL,
device_id TEXT NOT NULL,
temp DOUBLE PRECISION NULL,
humidity DOUBLE PRECISION NULL
);
CREATE INDEX ON conditions (time DESC NULLS LAST, device_id);
CREATE INDEX ON conditions (time DESC NULLS LAST, temp);
SELECT create_hypertable('"conditions"', 'time', 'device_id');