Mercurial > gemma
diff schema/gemma.sql @ 4006:3dc2694557f1
Speed up time based filtering of gauge measurements and predictions
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jul 2019 19:57:10 +0200 |
parents | a2921151b193 |
children | 9ab7e1056360 |
line wrap: on
line diff
--- a/schema/gemma.sql Thu Jul 18 19:49:56 2019 +0200 +++ b/schema/gemma.sql Thu Jul 18 19:57:10 2019 +0200 @@ -479,6 +479,8 @@ staging_done boolean NOT NULL DEFAULT false, UNIQUE (location, measure_date, staging_done) ) + CREATE INDEX gauge_measurements_measure_date + ON waterway.gauge_measurements (measure_date) CREATE TABLE gauge_predictions ( location isrs NOT NULL, @@ -500,6 +502,8 @@ source_organization varchar NOT NULL, -- "originator" from NtS response PRIMARY KEY (location, measure_date, date_issue) ) + CREATE INDEX gauge_predictions_measure_date + ON waterway.gauge_predictions (measure_date) CREATE TABLE waterway_axis ( id int PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,