asset/rate: speed up percent-queries

This commit is contained in:
Frederik Jaeckel 2023-06-23 16:02:31 +02:00
parent 8eaddc9b28
commit c06c2b8260
2 changed files with 29 additions and 26 deletions

View file

@ -53,6 +53,13 @@ class Rate(SymbolMixin, ModelSQL, ModelView):
Index(
t,
(t.rate, Index.Range())),
Index(
t,
(t.asset, Index.Equality())),
Index(
t,
(t.asset, Index.Equality()),
(t.date, Index.Range(order='DESC'))),
})
@classmethod