Hallo,
in der Doku ist diese Abfrage für das Löschen von Produkten:
DELETE aimr.*, aim.*, acta.*, actpa.*, actp.*, act.*, acor.*, av.*, atr.*, atop.*, ASiro.*, ASi.*, ar.*, apa.*, ap.*, an.*, aina.*, ain.*, aia.*, ai.*, aesds.*, aesda.*, aesd.*, adoa.*, ado.*, acs.*, acr.*, ac.*, acu.*, aa.*, ad.*, bro.*, a.*
FROM s_articles AS a
LEFT JOIN s_articles_also_bought_ro AS bro ON a.id = bro.article_id
LEFT JOIN s_articles_details AS ad ON a.id = ad.articleID
LEFT JOIN s_articles_attributes AS aa ON ad.id = aa.articledetailsID
LEFT JOIN s_articles_avoid_customergroups AS acu ON a.id = acu.articleID
LEFT JOIN s_articles_categories AS ac ON a.id = ac.articleID
LEFT JOIN s_articles_categories_ro AS acr ON a.id = acr.articleID
LEFT JOIN s_articles_categories_seo acs ON a.id = acs.article_id
LEFT JOIN s_articles_downloads AS ado ON a.id = ado.articleID
LEFT JOIN s_articles_downloads_attributes AS adoa ON ado.id = adoa.downloadID
LEFT JOIN s_articles_esd AS aesd ON a.id = aesd.articleID
LEFT JOIN s_articles_esd_attributes AS aesda ON aesd.id = aesda.esdID
LEFT JOIN s_articles_esd_serials AS aesds ON aesd.id = aesds.esdID
LEFT JOIN s_articles_img AS ai ON a.id = ai.articleID
LEFT JOIN s_articles_img_attributes AS aia ON ai.id = aia.imageID
LEFT JOIN s_articles_information AS ain ON a.id = ain.articleID
LEFT JOIN s_articles_information_attributes AS aina ON ain.id = aina.informatiONID
LEFT JOIN s_articles_notification AS an ON ad.ordernumber = an.ordernumber
LEFT JOIN s_articles_prices AS ap ON a.id = ap.articleID
LEFT JOIN s_articles_prices_attributes AS apa ON ap.id = apa.priceID
LEFT JOIN s_articles_relationships AS ar ON a.id = ar.articleID
LEFT JOIN s_articles_similar AS ASi ON a.id = ASi.articleID
LEFT JOIN s_articles_similar_shown_ro AS ASiro ON a.id = ASiro.article_id
LEFT JOIN s_articles_top_seller_ro AS atop ON a.id = atop.article_id
LEFT JOIN s_articles_translations AS atr ON a.id = atr.articleID
LEFT JOIN s_articles_vote AS av ON a.id = av.articleID
LEFT JOIN s_article_configurator_option_relations AS acor ON ad.id = acor.article_id
LEFT JOIN s_article_configurator_templates AS act ON a.id = act.article_id
LEFT JOIN s_article_configurator_template_prices AS actp ON act.id = actp.template_id
LEFT JOIN s_article_configurator_template_prices_attributes AS actpa ON actp.id = actpa.template_price_id
LEFT JOIN s_article_configurator_templates_attributes AS acta ON act.id = acta.template_id
LEFT JOIN s_article_img_mappings AS aim ON ai.id = aim.image_id
LEFT JOIN s_article_img_mapping_rules AS aimr ON aim.id = aimr.mapping_id
WHERE a.id = 1;
Wir haben diesen mal testweise nur auf die articleID = 1 gesetzt. Das Problem ist, dass dieses eine Produkt 20 Varianten hat, aber hier schon die Abfrage zum Löschen des Produkts in einen Timeout läuft, die Abfrage also solange läuft, bis der Server abstürzt.
Das bei 20 Zeilen, ich möchte aber gern 47.000 Zeilen löschen
Ich verstehe überhaupt nicht, was ich hier falsch mache.
Hat jemand eine Idee?
Danke!