Jump to content

slow queries 1.5.6 urgent


Recommended Posts

I need help as quickly as possible, since my host provider has trouble with my shop and menaces to suspend my site.

This trouble has occured 8 months ago and now again. That time i thought the problem was due to memcache that was down. It is not the case now. 

The following query with more around 2000 or's (i have truncated it and that way it works on phpmyadmin) was executed according with the file with the logs 12 times on 15 minutes 4 or 5 days ago.

My host provider says it should be a module, but i'vent installed nothing recently. My host provider says that other custommer  had similar troubles with the category block on homepage.

here is the truncated query. I attach the text file with allslowquery log.txt

 

SELECT product_shop.id_product, product_attribute_shop.id_product_attribute id_product_attribute

FROM `ps_product` p
INNER JOIN ps_product_shop product_shop
ON (product_shop.id_product = p.id_product AND product_shop.id_shop = 1)
LEFT JOIN `ps_product_attribute` pa ON (product_shop.id_product = pa.id_product)
LEFT JOIN ps_product_attribute_shop product_attribute_shop
ON (product_attribute_shop.id_product_attribute = pa.id_product_attribute AND 
product_attribute_shop.id_shop = 1 AND product_attribute_shop.default_on = 1)
WHERE product_shop.`active` = 1
AND (( product_shop.`id_product` = 3927) 
OR( product_shop.`id_product` = 3926) 
OR( product_shop.`id_product` = 3923) 
OR( product_shop.`id_product` = 821) 
OR( product_shop.`id_product` = 6630) 
OR( product_shop.`id_product` = 6629) 
OR( product_shop.`id_product` = 826) 
OR( product_shop.`id_product` = 6618) 
OR( product_shop.`id_product` = 6628) 
OR( product_shop.`id_product` = 6862) OR( product_shop.`id_product` = 6863) OR( product_shop.`id_product` = 6864) OR( product_shop.`id_product` = 6865) OR( product_shop.`id_product` = 6866) OR( product_shop.`id_product` = 6867) OR( product_shop.`id_product` = 6868) OR( product_shop.`id_product` = 6869) OR( product_shop.`id_product` = 6870) OR( product_shop.`id_product` = 6871) OR( product_shop.`id_product` = 6872) OR( product_shop.`id_product` = 6873) OR( product_shop.`id_product` = 6874) OR( product_shop.`id_product` = 6875) OR( product_shop.`id_product` = 6876) OR( product_shop.`id_product` = 6877) OR( product_shop.`id_product` = 6878) OR( product_shop.`id_product` = 6879) OR( product_shop.`id_product` = 6880) OR( product_shop.`id_product` = 6881) OR( product_shop.`id_product` = 6882) OR( product_shop.`id_product` = 6883) OR( product_shop.`id_product` = 6884) OR( product_shop.`id_product` = 6885) OR( product_shop.`id_product` = 6886) OR( product_shop.`id_product` = 6887) OR( product_shop.`id_product` = 6888) OR( product_shop.`id_product` = 6889) OR( product_shop.`id_product` = 6890) OR( product_shop.`id_product` = 6891) OR( product_shop.`id_product` = 6892) OR( product_shop.`id_product` = 6893) OR( product_shop.`id_product` = 6894) OR( product_shop.`id_product` = 6895) OR( product_shop.`id_product` = 6896) OR( product_shop.`id_product` = 6897) OR( product_shop.`id_product` = 6898) OR( product_shop.`id_product` = 6899) OR( product_shop.`id_product` = 6900) OR( product_shop.`id_product` = 6901) OR( product_shop.`id_product` = 6902) OR( product_shop.`id_product` = 6903) OR( product_shop.`id_product` = 6904) OR( product_shop.`id_product` = 6905) OR( product_shop.`id_product` = 6906) OR( product_shop.`id_product` = 6907) OR( product_shop.`id_product` = 6908) OR( product_shop.`id_product` = 6909) OR( product_shop.`id_product` = 6910) OR( product_shop.`id_product` = 6911) OR( product_shop.`id_product` = 6912) OR( product_shop.`id_product` = 6786) OR( product_shop.`id_product` = 1414) )
AND p.`id_product` IN (
SELECT cp.`id_product`
FROM `ps_category_group` cg
LEFT JOIN `ps_category_product` cp ON (cp.`id_category` = cg.`id_category`)
WHERE cg.`id_group` = 1
)
AND product_shop.`visibility` IN ("both", "catalog")
GROUP BY product_shop.id_product
ORDER BY RAND() LIMIT 1
 
 
 
Link to comment
Share on other sites

Thank you Tuk66.

You are right. Your suggestion solve my problem.

Before close this topic and mark it as solved may you or anybody tell me if i can reactivate the module changing the number of files in cache?

The cache was disabled with that value at 0.

What value you advice to put there?

Link to comment
Share on other sites

×
×
  • Create New...