Results 1 to 4 of 4
  1. #1

    Default Lower Database Queries

    Hi Guys running v1.5.6c currently and have a question! By necessity I am running a strange layout on my pages where the customer doesn't go to the product page but simply adds a range of products from the product listing page (https://kitchenwarehouseltd.com/comp...er-white-units)

    As you can see there are around 180+ products on this page and this is split up by a header to allow the page to flow nicely. The question I have is because the parse times display that I have "Number of Queries: 5451" on this page. I imagine this is as there are many for each product. I am wondering if there would be a way to remove any unused database queries as I think this should help the most with my page speeds as each query I could potentially remove will remove one for each of the 180+ products displayed on the page?

    For example if there is a query to the weight of the product I could remove this as my store does not use any weight calculations.

    Also just to note I have read and gone through many of the Attribute settings and configuration settings to turn of as much as I do not use

    Hope this all makes sense if anyone could point me in the right direction that would be amazing!

    Thanks
    Last edited by DannyVarley; 12 Nov 2019 at 01:38 PM.

  2. #2
    Join Date
    Jul 2012
    Posts
    14,693
    Plugin Contributions
    17

    Default Re: Lower Database Queries

    I can't recall if we've talked about this and honestly I'm not going to pull up history to find out at the moment. I did want to point out a couple of things though.

    One, I would have thought that if as in the example question, the need of a weight were turned off in the admin, then there would not be a specific query executed for weight. The weight value may come back in a related product query, but the data not used.

    The report of the number of queries performed may be a little "skewed". That value is determined by the number of times a question is asked and does not account for queries that have been cached. So if information about the image path for a specific product is asked twice (say once for the product and once for when showing it as a new product), the query is asked twice, but the second time it is asked, the cached result is provided. So, the database is searched once, but the question is asked twice.

    The request to show 181 products seems a bit excessive. Seems like if there is (though hasn't been described) a page load problem, then reducing that number would be beneficial. Alternatively (and haven't gone to look at the product) if there is some way to combine product that have variations, then that would be beneficial at least at the product listing stage, though it may then require looking at the product more to make the selection.

    Another potential savings may be possible if queries are more broad spectrum rather than one here, one there... it's not a guarantee, but it can be faster to process a lot of data returned to the code than to continue to ask the database more questions. Might be able to dig into that more if as discussed above, only the queries truly asked to the database (meaning cached excluded) were reviewed for commonalities and potential merging.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

  3. #3

    Default Re: Lower Database Queries

    Sorry its taken a while for a reply and thanks for your insight! At the moment it seems like I have managed to optimize the site enough where chasing these additional additions to the code would be chasing smaller gains than are needed. If I am honest there isnt a page load problem at the moment I have recently been in pursuit of making the page as fast as possible and you have to stop somewhere!

    I think when it gets to stripping out core code to make things faster when it is already fast enough I should probably stop! Again thanks for all your insight!

  4. #4
    Join Date
    Jul 2012
    Posts
    14,693
    Plugin Contributions
    17

    Default Re: Lower Database Queries

    Draw the line in the sand where you wish, but understand that there are times when even the core code needs modification to push improvement.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

 

 

Similar Threads

  1. v150 Store Database Queries
    By hubert in forum Upgrading to 1.5.x
    Replies: 10
    Last Post: 4 Jun 2013, 01:35 AM
  2. v150 [Done v1.6.0] Store Database Queries
    By hubert in forum Bug Reports
    Replies: 0
    Last Post: 3 Jun 2013, 02:02 AM
  3. Database queries - too many?
    By Anna718 in forum General Questions
    Replies: 10
    Last Post: 6 Dec 2008, 11:34 PM
  4. [Not a Bug] Logging :: Store Database Queries
    By shrimp-gumbo-mmmhhh in forum Bug Reports
    Replies: 4
    Last Post: 14 Aug 2008, 06:06 PM
  5. Store Database Queries?
    By SaveYourPhone in forum Basic Configuration
    Replies: 2
    Last Post: 18 Oct 2006, 05:10 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR