Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter daniesy

    (@daniesy)

    Also changing max_input_vars does not help me because I’m not trying to post anything. I’m experiencing issues on product pages, especially on those with lots of variations. This is a database issue.

    Thread Starter daniesy

    (@daniesy)

    Hey @laceyrod, thanks for your reply.
    I think I know the reason for why the site is loading slowly and it’s due to the fact the products I’ve added have a lot of variations. So, from my point of view, there’s no troubleshooting needed. I’ve watched the queries that are done when getting the variation or the price and they’re huge:

    SELECT wp_posts.ID FROM wp_posts LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )  LEFT JOIN wp_postmeta AS mt1 ON (wp_posts.ID = mt1.post_id AND mt1.meta_key = 'attribute_pa_type-impression') LEFT JOIN wp_postmeta AS mt2 ON ( wp_posts.ID = mt2.post_id )  LEFT JOIN wp_postmeta AS mt3 ON (wp_posts.ID = mt3.post_id AND mt3.meta_key = 'attribute_pa_faconnage' )  LEFT JOIN wp_postmeta AS mt4 ON ( wp_posts.ID = mt4.post_id )  LEFT JOIN wp_postmeta AS mt5 ON (wp_posts.ID = mt5.post_id AND mt5.meta_key = 'attribute_pa_support' )  LEFT JOIN wp_postmeta AS mt6 ON ( wp_posts.ID = mt6.post_id )  LEFT JOIN wp_postmeta AS mt7 ON (wp_posts.ID = mt7.post_id AND mt7.meta_key = 'attribute_pa_envoi-bat' )  LEFT JOIN wp_postmeta AS mt8 ON ( wp_posts.ID = mt8.post_id )  LEFT JOIN wp_postmeta AS mt9 ON (wp_posts.ID = mt9.post_id AND mt9.meta_key = 'attribute_pa_signature-impression-cool' )  LEFT JOIN wp_postmeta AS mt10 ON ( wp_posts.ID = mt10.post_id )  LEFT JOIN wp_postmeta AS mt11 ON (wp_posts.ID = mt11.post_id AND mt11.meta_key = 'attribute_pa_point-livraison' )  LEFT JOIN wp_postmeta AS mt12 ON ( wp_posts.ID = mt12.post_id )  LEFT JOIN wp_postmeta AS mt13 ON (wp_posts.ID = mt13.post_id AND mt13.meta_key = 'attribute_pa_choisissez-delai' )  LEFT JOIN wp_postmeta AS mt14 ON ( wp_posts.ID = mt14.post_id )  LEFT JOIN wp_postmeta AS mt15 ON (wp_posts.ID = mt15.post_id AND mt15.meta_key = 'attribute_pa_envoi-pour-revendeur' ) WHERE 1=1  AND wp_posts.post_parent = 162820  AND ( 
      ( 
        ( wp_postmeta.meta_key = 'attribute_pa_type-impression' AND wp_postmeta.meta_value IN ('','recto-seule') ) 
        OR 
        mt1.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt2.meta_key = 'attribute_pa_faconnage' AND mt2.meta_value IN ('','coupe-au-format-coins-carres') ) 
        OR 
        mt3.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt4.meta_key = 'attribute_pa_support' AND mt4.meta_value IN ('','dibond-reynolite-2-mm-blanc-2900-g-m%c2%b2') ) 
        OR 
        mt5.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt6.meta_key = 'attribute_pa_envoi-bat' AND mt6.meta_value IN ('','oui-10-e') ) 
        OR 
        mt7.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt8.meta_key = 'attribute_pa_signature-impression-cool' AND mt8.meta_value IN ('','non') ) 
        OR 
        mt9.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt10.meta_key = 'attribute_pa_point-livraison' AND mt10.meta_value IN ('','1-point') ) 
        OR 
        mt11.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt12.meta_key = 'attribute_pa_choisissez-delai' AND mt12.meta_value IN ('','express-j2') ) 
        OR 
        mt13.post_id IS NULL
      ) 
      AND 
      ( 
        ( mt14.meta_key = 'attribute_pa_envoi-pour-revendeur' AND mt14.meta_value IN ('','envoi-en-marque-blanche') ) 
        OR 
        mt15.post_id IS NULL
      )
    ) AND wp_posts.post_type = 'product_variation' AND ((wp_posts.post_status = 'publish')) GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order ASC LIMIT 0, 1

    Are there any steps I can take on the database that would improve query times? Is there a maximum amount of product/variations Woocommerce supports? I’ve noticed that once the wp_posts and wp_postmeta tables get big, the products take a lot of time to load.

Viewing 2 replies - 1 through 2 (of 2 total)