Post by zaidladha » Sun May 09, 2021 2:15 pm

Hi,

Can anyone help me identify what could be using this SQL statement? Unforunately I don't get much info from the slow query log that a2hosting is giving me. We are on their prestige VPS so I am not sure why we are maxing out the resources. This query stands out as taking long as it runs against all 80,000 products. I have no clue what is triggering it. www.stevestonmarine.com and on opencart 2.3.0.2

SELECT p.product_id, p.sort_order FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id AND pd.language_id = 1) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id AND p2s.store_id = 0) LEFT JOIN oc_product_to_category p2c ON (p.product_id = p2c.product_id) LEFT JOIN oc_category_description cd ON (p2c.category_id = cd.category_id) LEFT JOIN oc_manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.date_available <= NOW() AND p.status = 1 AND ((p.product_id =
Last edited by zaidladha on Fri Jul 23, 2021 1:56 pm, edited 1 time in total.

Active Member

Posts

Joined
Wed Jun 05, 2013 3:07 pm

Post by thekrotek » Sun May 09, 2021 3:20 pm

Looks like a generic query to get products.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by by mona » Sun May 09, 2021 7:59 pm

Why are you using the owl carousel for static images ? Total waste of valuable resources - both the carousel and the slideshow are very heavy to load and completely unnecessary for static images. You also have quite a lot of work to do on performance generally.

Use static images via custom html.
If you dont know how to do that - I have two modules that are very light and will do it for you - the first does loads of amazing stuff - the second can be used as a slideshow and per category/product. Both do what you want lightly.
https://www.opencart.com/index.php?rout ... n_id=33048
https://www.opencart.com/index.php?rout ... n_id=26852

However, it is so easy to do it by yourself.

Code: Select all

<div class="col-xs-12"><a href='xx'><img src="https://xxx.jpg" alt="xx" title="xx" class="xx"></a></div>
Remember to compress your images

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by paulfeakins » Mon May 10, 2021 6:41 pm

zaidladha wrote:
Sun May 09, 2021 2:15 pm
Can anyone help me identify what could be using this SQL statement?
You probably need a developer to have a look.

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


User avatar
Guru Member
Online

Posts

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

Post by halfhope » Thu May 20, 2021 11:57 pm

Hi!
This is not standart query from some module (most probably multiple-featured, that you use). This query (also as model_catalog_product->getProducts($data)) scans all records on database and getting result, and this is fine. To increase perfomance (not scan all records) SQL query shoud use index fields or woud be cached. I can help you with that.

My extensions in marketplace. [ security | flexibility | speedup ]


User avatar
Active Member

Posts

Joined
Tue Dec 10, 2013 9:44 pm
Location - San Diego

Post by zaidladha » Fri Jul 23, 2021 1:56 pm

by mona thanks for the tip! I have gone ahead and added it in usingly slightly different code. I didn't use the div and just went with the full width.

I think I figured out the module that was causing the issue, Product Labels Advanced.

Thanks for the help everyone!

Active Member

Posts

Joined
Wed Jun 05, 2013 3:07 pm
Who is online

Users browsing this forum: No registered users and 71 guests