Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
ee8a99c6 by Cédric Krier at 2022-12-30T13:59:04+01:00
Add index on id and lift

It can be used by the database to optimize the search of rules.

Closes #11843
- - - - -


1 changed file:

- modules/sale_product_recommendation_association_rule/sale.py


Changes:

=====================================
modules/sale_product_recommendation_association_rule/sale.py
=====================================
@@ -129,11 +129,16 @@
     def __setup__(cls):
         super().__setup__()
         t = cls.__table__()
-        cls._sql_indexes.add(
-            Index(
-                t,
-                (t.lift, Index.Range(order='DESC')),
-                (t.conviction, Index.Range(order='ASC'))))
+        cls._sql_indexes.update({
+                Index(
+                    t,
+                    (t.lift, Index.Range(order='DESC')),
+                    (t.conviction, Index.Range(order='ASC'))),
+                Index(
+                    t,
+                    (t.id, Index.Range()),
+                    (t.lift, Index.Range(order='DESC'))),
+                })
 
     def get_product_names(self, name):
         return ', '.join(



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/ee8a99c6b9e222de154007ca3d511d127fe713b0

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/ee8a99c6b9e222de154007ca3d511d127fe713b0
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to