CREATE TABLE tags (
    _id serial primary key,
    id integer,
    ts timestamp,
    value double precision
);


CREATE INDEX ON tags (id, ts);