Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Dec 2008
    Location
    Tasmania. Australia
    Posts
    38
    Plugin Contributions
    0

    Default Database queries - too many?

    I am currently in the process of setting up my site, but one thing I have notice is that the number of database queries on a product page are through the roof.

    I only have two products listed right now, though more will follow and on the product pages I am seeing 570 and 672 database queries, depending on which product I go to.

    I also run an Invision forum, and the worst page on that site, with a lot of extras, only results in about 60 queries per pageload.

    Why are there so many queries on a product page load for zen cart? 672 queries is a little over the top.

    I run image handler 2, have downloads turned off, and also have category counts turned off. I really want to reduce this before I go live.

    You can check out my site at RT Gallery username "Tester" password "user" (without quotes) both are case sensitive

    Any suggestions would be appreciated. Thanks

  2. #2
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Database queries - too many

    Quote Originally Posted by Anna718 View Post
    I am currently in the process of setting up my site, but one thing I have notice is that the number of database queries on a product page are through the roof.

    I only have two products listed right now, though more will follow and on the product pages I am seeing 570 and 672 database queries, depending on which product I go to.

    I also run an Invision forum, and the worst page on that site, with a lot of extras, only results in about 60 queries per pageload.

    Why are there so many queries on a product page load for zen cart? 672 queries is a little over the top.

    I run image handler 2, have downloads turned off, and also have category counts turned off. I really want to reduce this before I go live.

    You can check out my site at RT Gallery username "Tester" password "user" (without quotes) both are case sensitive

    Any suggestions would be appreciated. Thanks
    This will be addressed in v1.4.0 releasing this month (or so I heard)
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Database queries - too many

    Version 1.4 (theoretically due out this year - we'll see) addresses this in a big way.
    See the roadmap in the Zen Cart Release Announcements forum.

  4. #4
    Join Date
    Dec 2008
    Location
    Tasmania. Australia
    Posts
    38
    Plugin Contributions
    0

    Default Re: Database queries - too many

    Thanks yellow1912.

    I certainly hope it is, as this is over the top.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Database queries - too many

    LOL ... keep in mind ... unlike a forum, with an ecommerce site you're dealing with display and calculation of sales, specials, taxes, extra sideboxes for displaying different pieces of information in different ways, product listings, categories, images, etc.

    That said, it's a well-known fact that v1.3 and earlier inherited some bad query structures from the initial code base. A huge amount of that has been rewritten for 1.4, as explained above, and detailed in the roadmap.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Dec 2008
    Location
    Tasmania. Australia
    Posts
    38
    Plugin Contributions
    0

    Default Re: Database queries - too many?

    Understandable Sensei, but on my forum, which is very heavily modified, there are probably more individual pieces of data being displayed that I see on my product pages. As for images, they do not cause database queries, or at least they should not, and my forum has heavy graphics, with images up to 10Mb each in place sometimes 30 to a page.

    I have zero tax rates, no specials, zero reviews, and only two products in one category right now. I shudder to think what will happen once the store is fully populated.

    IT worries me as my hosts have a limit on 20,000 database queries per hour, and with 670+ queries on a single page load, that limit can be reached far too quickly. No page requires 670 database queries, especially when 99.9999999% of the information is static, the only thing that might change is the stock level.

  7. #7
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Database queries - too many?

    The category tree is the main cause for the current number of queries. Especially if you have too many categories.

    You may consider caching it and other blocks that may use too many queries
    http://www.zen-cart.com/forum/showth...ighlight=cache

    Or use an alternative category tree that uses less query.
    This one for example, using a single query along with caching as well:
    http://www.zen-cart.com/forum/showth...+category+tree

    Or you can wait till 1.4 coming out, please make it an XMAS gift for us, DrByte
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  8. #8
    Join Date
    Dec 2008
    Location
    Tasmania. Australia
    Posts
    38
    Plugin Contributions
    0

    Default Re: Database queries - too many?

    Thanks yellow1912, but I would prefer to avoid caching the product pages as stock levels will be strictly limited, and although I could manage that with cron, I just prefer not to.

    One thing that I do not understand is that if you look at the two product pages I currently have in place, the first has 8 options for attributes and the second has 6 options. Why would there be around 100 extra database queries for the first than the second, when all other page details are identical? Two more options creates 100 database queries does not make programming logic sense????

    Please bring on 1.4

  9. #9
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Database queries - too many?

    Again, you can thank the folks over at the other shopping cart that wrote the original attributes code with a weak database structure and bloated inefficient coding.
    The 1.4 version will make a huge difference in performance in these areas.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Nov 2008
    Location
    New Jersey, USA
    Posts
    14
    Plugin Contributions
    0

    bug Re: Database queries - too many?

    Cool Website, What tool did you use to handle your Pics?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Help with SQL Queries - Have too many
    By need_help in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 8 Apr 2009, 02:47 PM
  2. Too many SQL queries of the same contribution
    By bigjoed in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 26 Apr 2007, 05:16 AM
  3. Too many queries were running? -- a bug?
    By doubletiger in forum General Questions
    Replies: 6
    Last Post: 17 Nov 2006, 10:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg