Jump to content

Brand page


Recommended Posts

Hello 

In the backoffice catalog=>brands this statement is executed.

Only this SQL statement is too heavy for large shops causing the server to timeout.

SELECT SQL_CALC_FOUND_ROWS a.* , COUNT(`id_product`) AS `products`, ( SELECT COUNT(ad.`id_manufacturer`) as `addresses` FROM `ps_address` ad WHERE ad.`id_manufacturer` = a.`id_manufacturer` AND ad.`deleted` = 0 GROUP BY ad.`id_manufacturer`) as `addresses` FROM `ps_manufacturer` a LEFT JOIN `ps_product` p ON (a.`id_manufacturer` = p.`id_manufacturer`) WHERE 1 AND EXISTS ( SELECT 1 FROM `ps_manufacturer_shop` sa WHERE a.`id_manufacturer` = sa.`id_manufacturer` AND sa.id_shop IN (1) ) GROUP BY a.`id_manufacturer` ORDER BY name ASC LIMIT 0, 50;

(Even straight in phpMyAdmin)

Where is this defined and how can I rewrite it so it is much faster?

Link to comment
Share on other sites

1 hour ago, Sickboards said:

Only this SQL statement is too heavy for large shops causing the server to timeout.

How much power has your server?
PHP.ini settings for timeout? Execution times, memory etc.?

Link to comment
Share on other sites

1 hour ago, Sickboards said:

I don't think it my server...

Depends on you php.ini settings  max_input_time  default is 60s I set that to 300 usually max_input_vars from 1000 to 10000.
You need yo restart apache2 to make changes settle.  

Link to comment
Share on other sites

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
×
×
  • Create New...