medyczny Posted November 13, 2020 Share Posted November 13, 2020 Czesc. Dostałem informację od firmy hostingowej, że Problem z zapytaniem do bazy danych, który powoduje 100% użycia CPU na serwerze MySQL powraca. Czy może mi ktoś podpowiedzieć gdzie może leżeć problem ? Zapytanie które powoduje błąd to : SELECT 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 p.visibility IN ('both', 'catalog') AND c.nleft>=353 AND c.nright<=386 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) 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_stock_available sa_1 ON (p.id_product = sa_1.id_product AND IFNULL(pac.id_product_attribute, 0) = sa_1.id_product_attribute AND sa_1.id_shop = 1 AND sa_1.id_shop_group = 0 ) WHERE ((sa.quantity<=0 AND sa_1.out_of_stock IN (0, 2))) Link to comment Share on other sites More sharing options...
krzysiek_web Posted November 13, 2020 Share Posted November 13, 2020 (edited) Zapewne jakiś kiepski moduł np. slider z produktami na stronie głównej. A jak do tego dojdzie jakiś appagebuilder to już nie ma co dalej mówić... Włącz profilowanie i sprawdź który to moduł. Edited November 13, 2020 by krzysiuus (see edit history) Link to comment Share on other sites More sharing options...
medyczny Posted November 13, 2020 Author Share Posted November 13, 2020 a jak włączyć to profilowanie ? mam szablon warehouse i tam jest włączony moduł ze sleiderami Link to comment Share on other sites More sharing options...
krzysiek_web Posted November 14, 2020 Share Posted November 14, 2020 PS_DEBUG_PROFILING na true w defines.inc.php Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now