CREATE TABLE speedtest_entry ( id bigserial PRIMARY KEY, ip inet, timestamp timestamptz ); CREATE TABLE speedtest_result ( id bigserial PRIMARY KEY, entry_id bigint REFERENCES speedtest_entry (id), node varchar(32), speed float8 );