Jump to content

Navigation à facette ps_facetedsearch requête lente : MySQLTest.php?


Recommended Posts

Posted (edited)

Bonjour,

Presta V 1.7.6.7, ps_facetedsearch V 3.5.0 (avant de me dire qu'il faut update, j'aimerai savoir d'où ça vient)

Pour le site d'un client, nous avons nos log de requêtes lente gavé de cette requête :

SELECT fp.id_feature, fp.id_feature_value, 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, pl.name 
	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 ) 
	INNER JOIN ps_product_lang pl ON (p.id_product = pl.id_product AND pl.id_shop = 1 AND pl.id_lang = 1) 
	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)
	LEFT JOIN ps_feature_product fp ON (p.id_product = fp.id_product) 
	LEFT JOIN ps_feature_product fp_1 ON (p.id_product = fp_1.id_product) 
	LEFT JOIN ps_feature_product fp_2 ON (p.id_product = fp_2.id_product) 
	LEFT JOIN ps_feature_product fp_3 ON (p.id_product = fp_3.id_product) 
	LEFT JOIN ps_feature_product fp_4 ON (p.id_product = fp_4.id_product) 
	LEFT JOIN ps_feature_product fp_5 ON (p.id_product = fp_5.id_product) 
	WHERE ((fp.id_feature_value=16)) AND ((fp_1.id_feature_value=62)) AND ((fp_2.id_feature_value=66)) AND ((fp_3.id_feature_value=80)) AND ((fp_4.id_feature_value=98)) AND ((fp_5.id_feature_value=99)) AND p.visibility IN ('both', 'catalog') AND c.nleft>=283 AND c.nright<=284 AND ps.id_shop='1' GROUP BY p.id_product
) p 
INNER JOIN ps_feature_product fp ON (p.id_product = fp.id_product) 
LEFT JOIN ps_feature_product fp_1 ON (p.id_product = fp_1.id_product) 
LEFT JOIN ps_feature_product fp_2 ON (p.id_product = fp_2.id_product) 
LEFT JOIN ps_feature_product fp_3 ON (p.id_product = fp_3.id_product) 
LEFT JOIN ps_feature_product fp_4 ON (p.id_product = fp_4.id_product) 
LEFT JOIN ps_feature_product fp_5 ON (p.id_product = fp_5.id_product) 
LEFT JOIN ps_feature_product fp_6 ON (p.id_product = fp_6.id_product) 
WHERE ((fp.id_feature=1)) AND ((fp_1.id_feature_value=16)) AND ((fp_2.id_feature_value=62)) AND ((fp_3.id_feature_value=66)) AND ((fp_4.id_feature_value=80)) AND ((fp_5.id_feature_value=98)) AND ((fp_6.id_feature_value=99)) 
GROUP BY fp.id_feature_value;

Je n'arrive pas à identifier exactement d'où sort cette requête.

Mon exploration du code m'a amené au fichier "modules/ps_facetedsearch/tests/php/FacetedSearch/Adapter/MySQLTest.php" par ce qu'il n'y a que là que je trouve "SUM(sa.quantity)" par exemple.

Si ça vient bien de là, comment le désactiver? Je ne tiens pas à faire tourner des tests unitaire sur la base de prod et encore moins sur le serveur de prod. Ca impacte les perf de nos autres sites.

Une idée?

Edited by Lorem Ipsum (see edit history)

Share this post


Link to post
Share on other sites

  • Lorem Ipsum changed the title to Navigation à facette ps_facetedsearch requête lente : MySQLTest.php?

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More