annotate schema/updates/1202/01.fix_data_availability.sql @ 4449:ce884af9f42f

Fix forecast accuracy values and improve performance Forecast accuracy should be based only on the most recent predictions. Generally consider measurements and predictions older than 14 days as outdated and irrelevant. This also implies a performance gain, since it saves a full scan of gauge_measurements and the extra index for this purpose. Adding an extra subquery level for calculation of the forecast accuracy per row instead of the function call as a FROM item saves a (nested loop) join, which is another performance gain.
author Tom Gottfried <tom@intevation.de>
date Fri, 20 Sep 2019 13:22:45 +0200
parents
children 9b9f60e26b39
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4449
ce884af9f42f Fix forecast accuracy values and improve performance
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
1 \ir ../../geoserver_views.sql;
ce884af9f42f Fix forecast accuracy values and improve performance
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
2
ce884af9f42f Fix forecast accuracy values and improve performance
Tom Gottfried <tom@intevation.de>
parents:
diff changeset
3 DROP INDEX waterway.gauge_measurements_location_measure_date_desc