Jump to content

Backend slow on Customers tab


Recommended Posts

My webshop runs great, except for one thing. When I click on the "Customers" tab, it takes around 10 seconds for that page to load. If I click on Customer Service, that page will load in 18 seconds. I only have around 900 messages so it cannot be because of that.

The rest of the backend, and the entire site, runs very smooth.

 

This is the slow query that was logged by the server:

 

SELECT SQL_CALC_FOUND_ROWS

  a.*, CONCAT(c.firstname," ",c.lastname) as customer, cl.name as contact, l.name as language, group_concat(message) as messages, (
  SELECT IFNULL(CONCAT(LEFT(e.firstname, 1),". ",e.lastname), "--")
  FROM ps_customer_message cm2 INNER JOIN ps_employee e ON e.id_employee = cm2.id_employee
  WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread`
  ORDER BY cm2.date_add DESC LIMIT 1) as employee
  FROM `ps_customer_thread` a


 LEFT JOIN `ps_customer` c ON c.`id_customer` = a.`id_customer`
 LEFT JOIN `ps_customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread`
 LEFT JOIN `ps_lang` l ON l.`id_lang` = a.`id_lang`
 LEFT JOIN `ps_contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = 20)
  WHERE 1
  GROUP BY cm.id_customer_thread

  ORDER BY `date_upd` DESC
  LIMIT 0,50;

 

There is also a warning that says:

 

895 rows in set, 1 warning (16.40 sec)
mysql> show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1260 | 345 line(s) were cut by GROUP_CONCAT() |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)

 

I use 1.4.7 but have tried up to 1.4.9 with no change in speed (I switched back due to module compatibility, and I have not tried 1.5 at all)

 

Any help on this would be really appreciated. It is a pain to wait for the Customer Service page to load every time I need to answer some messages.

Link to comment
Share on other sites

  • 1 year later...

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...