Jump to content

Slow queries !


PC33
 Share

Recommended Posts

Hello everyone, my host company is complaining about some slow queries on MYSQL for Prestashop 1.4.0.9 and im really desperate with this situation and they will to shut down the site because im consuming to many resources, this is the last log they sent me a few minutes ago, please i really need help by some one with skills on this situation.

 

Thank you all:

Executed 21 min ago for 1 sec on Database --> gamekeys_4all.
SELECT * FROM `ps_orders` o LEFT JOIN `ps_order_detail` od ON (od.`id_order` = o.`id_order`) LEFT JOIN `ps_order_history` oh ON (oh.`id_order` = o.`id_order`) WHERE oh.id_order_state IN (5) ORDER BY o.date_upd desc LIMIT 20
Executed 21 min ago for 1 sec on Database --> gamekeys_4all.
SELECT SQL_CALC_FOUND_ROWS a.*, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `ps_orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, (SELECT COUNT(od.`id_order`) FROM `ps_order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number FROM `ps_orders` a LEFT JOIN `ps_customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `ps_order_history` oh ON (oh.`id_order` = a.`id_order`) LEFT JOIN `ps_order_state` os ON (os.`id_order_state` = oh.`id_order_state`) LEFT JOIN `ps_order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 1) WHERE 1 AND oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `ps_order_history` moh WHERE moh.`id_order` = a.`id_order` GROUP BY moh.`id_order`) ORDER BY `date_add` DESC LIMIT 0,50
Executed 20 min ago for 1 sec on Database --> gamekeys_4all.
SELECT * FROM `ps_orders` o LEFT JOIN `ps_order_detail` od ON (od.`id_order` = o.`id_order`) LEFT JOIN `ps_order_history` oh ON (oh.`id_order` = o.`id_order`) WHERE oh.id_order_state IN (5) ORDER BY o.date_upd desc LIMIT 20
Executed 19 min ago for 1 sec on Database --> gamekeys_4all.
SELECT SQL_CALC_FOUND_ROWS a.*, a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), '. ', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `ps_orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, (SELECT COUNT(od.`id_order`) FROM `ps_order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number FROM `ps_orders` a LEFT JOIN `ps_customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `ps_order_history` oh ON (oh.`id_order` = a.`id_order`) LEFT JOIN `ps_order_state` os ON (os.`id_order_state` = oh.`id_order_state`) LEFT JOIN `ps_order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = 1) WHERE 1 AND oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `ps_order_history` moh WHERE moh.`id_order` = a.`id_order` GROUP BY moh.`id_order`) ORDER BY `date_add` DESC LIMIT 0,50
Executed 11 min ago for 1 sec on Database --> gamekeys_4all.
SELECT * FROM `ps_orders` o LEFT JOIN `ps_order_detail` od ON (od.`id_order` = o.`id_order`) LEFT JOIN `ps_order_history` oh ON (oh.`id_order` = o.`id_order`) WHERE oh.id_order_state IN (5) ORDER BY o.date_upd desc LIMIT 20

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

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