mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 20:11:16 +00:00
Performance optimizations
This commit is contained in:
@@ -8,7 +8,10 @@ SELECT
|
||||
p.name AS product_name,
|
||||
plp.price * IFNULL(qucr.factor, 1.0) AS last_price_unit,
|
||||
plp.price * IFNULL(qucr.factor, 1.0) * sl.amount AS last_price_total,
|
||||
st.name AS default_shopping_location_name
|
||||
st.name AS default_shopping_location_name,
|
||||
qu.name AS qu_name,
|
||||
qu.name_plural AS qu_name_plural,
|
||||
pg.name AS product_group_name
|
||||
FROM shopping_list sl
|
||||
LEFT JOIN products p
|
||||
ON sl.product_id = p.id
|
||||
@@ -19,4 +22,8 @@ LEFT JOIN quantity_unit_conversions_resolved qucr
|
||||
LEFT JOIN products_last_purchased plp
|
||||
ON sl.product_id = plp.product_id
|
||||
LEFT JOIN shopping_locations st
|
||||
ON p.shopping_location_id = st.id;
|
||||
ON p.shopping_location_id = st.id
|
||||
LEFT JOIN quantity_units qu
|
||||
ON sl.qu_id = qu.id
|
||||
LEFT JOIN product_groups pg
|
||||
ON p.product_group_id = pg.id;
|
||||
|
@@ -109,3 +109,13 @@ BEGIN
|
||||
DELETE FROM battery_charge_cycles
|
||||
WHERE battery_id = OLD.id;
|
||||
END;
|
||||
|
||||
CREATE INDEX ix_chores_performance1 ON chores (
|
||||
id,
|
||||
active
|
||||
);
|
||||
|
||||
CREATE INDEX ix_batteries_performance1 ON batteries (
|
||||
id,
|
||||
active
|
||||
);
|
||||
|
Reference in New Issue
Block a user