Post by aaron1988 » Mon Feb 20, 2017 3:09 am

Hi,

I have enabled Slow Query log on my VPS, so can just find out why this site on homepage is so so slow: http://www.fairwayimporters.co.uk

so i looked in the Slow query log and it keeps outputting the same query:

Code: Select all

# Query_time: 12.909576  Lock_time: 0.000132  Rows_sent: 4  Rows_examined: 56210
SET timestamp=1487530199;
SELECT p.product_id, (SELECT AVG(rating) AS total FROM oc_review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT price FROM oc_product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '1' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM oc_product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '1' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' GROUP BY p.product_id ORDER BY p.date_added DESC, LCASE(pd.name) DESC LIMIT 0,4;
its only this site that seems to be doing it that uses the same Theme (Journal 2). On a Fresh install the query time when run via phpmyadmin is like 0.2 seconds but on this particular store it takes like 12 Seconds.

Is there a reason for this, all tables are now converted to: Innodb / Indexed. as i used the script turbo.php which is posted around on the forum.

Hope someone else can help with this as i just do not understand why this 1 query takes this long :(

Thanks
Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by paulfeakins » Mon Feb 20, 2017 8:18 pm

aaron1988 wrote:
Mon Feb 20, 2017 3:09 am
its only this site that seems to be doing it that uses the same Theme (Journal 2).
If you switch to another theme or the Default theme, is it still slow?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by aaron1988 » Mon Feb 20, 2017 9:45 pm

Hi,

I installed a Fresh copy of the theme with all Demo Data it all loads fine.

I exported all products from old database to this new one site is SLOW. so i emptied the table: product_description then it loads FINE.

This table is using: Innodb shall i rever this one back to MyISAM ? and remove the index from table?

Thanks
Aaron

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am

Post by aaron1988 » Mon Feb 20, 2017 10:14 pm

Default theme it loads fine. i tested.

Active Member

Posts

Joined
Thu Jan 27, 2011 10:03 am
Who is online

Users browsing this forum: No registered users and 1 guest