Hallo zusammen,
folgender Prozess in der Datenbank dauert extrem lange und verursascht teilweise einen Timeout beim öffnen der Artikeldetailseite.
Dies Problem ist heute plötzlich aufgetretten. Einige Artikel lassen ohne Probleme öffnen. Bei anderen dauert dieser Prozess in der Datenbank extrem lange.
Hatte das Problem schon mal jemand?
SW: 5.6.8
Server-Version: 10.1.37-MariaDB
SELECT SQL_CALC_FOUND_ROWS product.id as __product_id, variant.id as__ variant_id, variant.ordernumber as __variant_ordernumber FROM s_articles product INNER JOIN s_articles_details variant ON variant.id = product.main_detail_id AND variant.active = 1 AND product.active = 1 LEFT JOIN s_articles_avoid_customergroups avoidCustomerGroup ON avoidCustomerGroup.articleID = product.id AND avoidCustomerGroup.customerGroupId IN (1) INNER JOIN s_articles_categories_ro productCategory ON productCategory.articleID = product.id AND productCategory.categoryID IN (3) INNER JOIN (SELECT prices.*, MIN(ROUND(prices.price * ((100 - IFNULL(priceGroup.discount, 0)) / 100) * (( (CASE tax.id WHEN 1 THEN 16 WHEN 5 THEN 0 END) + 100) / 100) * 1, 2)) as cheapest_price FROM s_articles product INNER JOIN s_core_tax tax ON tax.id = product.taxID INNER JOIN (SELECT defaultPrice.`id`,defaultPrice.`pricegroup`,defaultPrice.`from`,defaultPrice.`to`,defaultPrice.`articleID`,defaultPrice.`articledetailsID`,defaultPrice.`price`,defaultPrice.`pseudoprice`,defaultPrice.`percent`,defaultPrice.articleID as product_id,defaultPrice.articledetailsID as variant_id FROM s_articles_prices defaultPrice WHERE defaultPrice.pricegroup = 'EK') prices ON product.id = prices.articleID INNER JOIN s_articles_details availableVariant ON availableVariant.articleID = product.id AND availableVariant.active = 1 LEFT JOIN s_core_pricegroups_discounts priceGroup ON priceGroup.groupID = product.pricegroupID AND priceGroup.discountstart = 1 AND priceGroup.customergroupID = '1' AND product.pricegroupActive = 1 WHERE (prices.articledetailsID = availableVariant.id) AND (prices.from = 1) GROUP BY product.id) listing_price ON listing_price.articleID = product.id INNER JOIN s_articles_attributes productAttribute ON productAttribute.articledetailsID = variant.id WHERE (avoidCustomerGroup.articleID IS NULL) AND ((productAttribute.swkwe_show_soldout = 1) OR (EXISTS (SELECT * FROM s_articles_details swkweAvailableDetail WHERE (swkweAvailableDetail.articleID = product.id) AND (swkweAvailableDetail.active = 1) AND ((swkweAvailableDetail.instock - '0' >= swkweAvailableDetail.minpurchase) OR (swkweAvailableDetail.laststock = 0)))) OR (productAttribute.swkwe_category_show_soldout = 1)) AND (variant.articleId IN (16799, 16800)) AND (((productAttribute.dvsn_configurator_status IS NULL) OR (productAttribute.dvsn_configurator_status = 0))) GROUP BY product.id ORDER BY listing_price.cheapest_price ASC, variant.id ASC LIMIT 100