Jump to content

Prestashop 1.7 Query Problem


Recommended Posts

Hallo Zusammen 

mein Hoster meldet das mein Prestashop zum teil sehr langsame Querys hat. 

Shopversion: 1.7.6.2

Template: Warehouse

 

Folgendes Query hat ein Ladezeit von 9.7s

SELECT pac.id_attribute, COUNT(DISTINCT p.id_product) c FROM (SELECT p.id_product, p.id_manufacturer, SUM(sa.quantity) as quantity, p.condition, p.weight, p.price, psales.quantity as sales, cp.position FROM ps_product p LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product) LEFT JOIN ps_product_attribute_combination pac ON (pa.id_product_attribute = pac.id_product_attribute) LEFT JOIN ps_stock_available sa ON (p.id_product = sa.id_product AND IFNULL(pac.id_product_attribute, 0) = sa.id_product_attribute AND sa.id_shop = 1  AND sa.id_shop_group = 0 ) LEFT JOIN ps_product_sale psales ON (psales.id_product = p.id_product) INNER JOIN ps_category_product cp ON (p.id_product = cp.id_product) INNER JOIN ps_category c ON (cp.id_category = c.id_category AND c.active=1) INNER JOIN ps_product_shop ps ON (p.id_product = ps.id_product AND ps.id_shop = 1 AND ps.active = TRUE) WHERE ((pac.id_attribute IN (198, 199, 201, 205))) AND p.visibility IN ('both', 'catalog') AND c.nleft>=126 AND c.nright<=127 AND ps.id_shop='1' GROUP BY p.id_product) p LEFT JOIN ps_product_attribute pa ON (p.id_product = pa.id_product) LEFT JOIN ps_product_attribute_combination pac ON (pa.id_product_attribute = pac.id_product_attribute) INNER JOIN ps_attribute a ON (a.id_attribute = pac.id_attribute) LEFT JOIN ps_product_attribute_combination pac_1 ON (pa.id_product_attribute = pac_1.id_product_attribute) WHERE ((a.id_attribute_group=21)) AND ((pac_1.id_attribute IN (198, 199, 201, 205))) GROUP BY pac.id_attribute;

Am Shop selber habe ich in letzter Zeit nichts verändert, ausser ein Update des Templates. 

Bin nun dran ein BackUp zu erstellen und dann den Shop auf die neuste PS Version zu Updaten. 

Bin leider nicht so bewandt mit Mysql und Querys.

Trotzdem würde ich gerne verstehen woran das Problem liegen kann? 

Danke Euch. 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...