Refine index definition

- Set low and high cardinality to index usage
- Use Range usage for numerical expression instead of Equality
This commit is contained in:
Cédric Krier
2024-07-27 18:36:14 +02:00
parent 234daa0f99
commit a2dfc4455b
64 changed files with 171 additions and 149 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class Forecast(Workflow, ModelSQL, ModelView):
cls._sql_indexes.add(
Index(
t,
(t.state, Index.Equality()),
(t.state, Index.Equality(cardinality='low')),
(t.to_date, Index.Range())))
cls.create_date.select = True
cls._order.insert(0, ('from_date', 'DESC'))