1

I would to know what is the right average number of db queries in a standard installation of magento for catalog pages, because I think to have a big problem with my pages.

My catalog page does about 2000 queries! This is too much and I think that is the reason that my pages are so slow.

Furthermore if you open magento toolbar (at top right) and open queries's table, you can see that more queries are executed many times, query like this:

SELECT `eav_attribute_set`.* FROM `eav_attribute_set` WHERE (eav_attribute_set.attribute_set_id='10') 

And it seems to be a loop.

Now I have to find the problem, maybe some bad extension or bad custom code, but what could be the right number of queries for catalog pages?

6
  • 1
    suggestion to remove the link if it's really doing that many queries per page load. You don't want your server to go down, do you? Commented Aug 3, 2012 at 15:11
  • nono! please! :) but this is a staging server....do you know how many queries are the right average? so i have a big problem :( Commented Aug 3, 2012 at 15:46
  • 3
    I've ran a test on a catalog product list page on a fresh Enterprise installation, resulting in around 80 queries. So there is a big difference. You might want to go to Varien_Db_Adapter_Pdo_Mysql and set the following variables to true: $_debug, $_logAllQueries and $_logCallStack. Especially the last one $_logCallStack might come in handy. It logs the backtrace of those methods that triggered the query. The logfile can be found under /var/debug/. Commented Aug 3, 2012 at 21:49
  • @D.Milito just to clarify - I wasn't threatening! - I was advising :) Commented Aug 4, 2012 at 9:12
  • 2
    You should have a look on the attribute_set with the id 10. Might be products, but I don't think so. I think some extension is badly coded and makes many ->load() calls, so there are many querys fired. Commented Aug 4, 2012 at 21:21

1 Answer 1

1

Tim Hofman's answer (with wee-developer toolbar installed) was very useful to understand which queries were bad coded by developer before me.

Almost all these queries were load() to retrieve the full product when needed only one product's attribute, so i edited the code.

thx for replies! :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.