Mercurial > gemma
diff 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 |
line wrap: on
line diff