Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author KevinMcCall

    (@kevinmccall)

    Hi,

    I can’t access the images in your support request (getting a 503 error).

    In general, the plugin needs to look up the products upon which a product or variation is dependent in order to determine the inventory that is in stock. If you have many variations of a product, and each of those variations have one or more stock dependencies, then the plugin will need to look up the inventory ( number of dependencies ) x ( number of variations ) times.

    How many products or variations are you displaying on the web page and how many dependencies does each have when you are seeing the numerous queries being executed?

    Kevin

    • This reply was modified 3 years, 5 months ago by KevinMcCall.
    Thread Starter afsl01

    (@afsl01)

    Hi Kevin.

    Here are the screenshots again.

    https://drive.google.com/file/d/1RjcSCY-94zRkP5TuyB7aag_pUzQP451A
    https://drive.google.com/file/d/1WFFWCTSziioMW0TAXOH3fVvUoSyNhNxq
    https://drive.google.com/file/d/1Wj9vMfC6A_P0WOAoQip45kOhPA2vI3dL

    For the shop page, the worst scenario could be the grid view displaying up to 16 products, each of one have arround 10-18 variations and each variation have only 1 stock dependency.

    Therefore on a single prduct page there should be up to 18 queries for the product with most variations.

    Thanks in advance.

    Plugin Author KevinMcCall

    (@kevinmccall)

    Some of the plugin functions can get called multiple times for each product or variation. For example, WooCommerce checks the inventory status (true/false) and the inventory quantity (number) separately and often for the same product or variation on a single page.

    In addition to that, because the plugin only stores the SKU of the stock dependency, then the plugin currently has to look up the product/variation ID for multiple plugin functions.

    I have some ideas about how I can reduce the number of function calls the plugin needs to make, but I’ll have to do some testing to see if it’s feasible.

    Plugin Author KevinMcCall

    (@kevinmccall)

    Hey there, I just release v1.4 of the plugin. In this update I’ve implemented an approach that will result in fewer DB queries, specifically when looking up products configured as stock dependencies.

    I’m curious to know if this improves the performance on your site.

    Thread Starter afsl01

    (@afsl01)

    Hi Kevin, sorry for the late response.

    Ive updated to v1.4 and saw no difference at first.

    But today Ive made some changes, and now I see that the queries has been seriously reduced.

    I was using WP Sheet editor plugin to bulk edit stock dependencies and so the string format before updating to V1.4 where like this: {“enabled”:true,”stock_dependency”:[{“sku”:”_ON900A-256″,”qty”:”1″}]}

    As today I was making some new changes on some new added products I ve found that the strings format have changed to this on V1.4:

    {“enabled”:true,”stock_dependency”:[{“sku”:”_ON900A-256″,”qty”:”1″,”product_id”:4604}]}

    Then Ive looked at the changelog on Github and found that the approach you used on this new update added “product id” to the stock dependencies rules.

    So therefore Ive replaced the rules of an old product with this new format and suprise, Ive saw the queries are now much less than before (Eg on a single product page the queries went from 370 to 230 aprox)

    Now I have to redo a lot of this rules to update to the new format.

    Thanks you so much for your help.
    Best regards.`

    • This reply was modified 3 years, 2 months ago by afsl01.
    • This reply was modified 3 years, 2 months ago by afsl01.
    Plugin Author KevinMcCall

    (@kevinmccall)

    Thanks for the update. Yes, the metadata will only get updated if you update the stock dependencies via admin (or directly in the DB as you did).

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘High amount of Queries’ is closed to new replies.