Support » Plugin: WooCommerce » Transient customer_bought_product problem

  • Resolved Demian

    (@demian85)


    Hello Team,

    I have a major problem with native transients created by woocommerce. They are the transient _transient_wc_cbp_ and _transient_timeout_wc_cbp_. I believe they are created in the wc-user-functions.php file on line 209.

    We have around 40 transactions per day, but it creates after a couple of weeks 100K’s of these transient lines in wp_options. Sometimes it flows over 1M lines, and every time I need to empty the transients by going to woocommerce > status > tools > clear transients, because the database gets easily over 500MB. The site becomes slow because of this. There are no cron issues, I already checked.

    Why are these transients created and more important how do I avoid them?

    With thanks,
    Demian

Viewing 5 replies - 1 through 5 (of 5 total)
  • Soft79

    (@josk79)

    Is the autoload column of your options table indexed?

    https://guides.wp-bullet.com/add-mysql-index-wordpress-wp_options-table/

    Demian

    (@demian85)

    Thank you @josk79 ,

    wp_options appeared not to have an autoload column. I have created this and see if it will improve.

    Due to the wp_options, does this cause also a bloated database for wp_postmeta (900K lines) and wp_comments (87K lines)? I have manually checked these databases, but I can’t find any duplicates or expired lines, they seem to be connected with the existing 14K orders. If so, is there a way to shrink them?

    Much appreciated!

    Soft79

    (@josk79)

    It didn’t have an autoload column? I don’t think that’s even possible. Or did you mean to say the column didn’t have an index?

    postmeta is not related to the wp_options stuff. This just means that you have a lot of posts (including products, orders, …). comments do also include the stock change notices for every order.

    FWIW: Automattic is working on incorporating separate tables for orders and products.

    Demian

    (@demian85)

    @josk79 yes my fault, incorrect wording. I mean there was no index.

    Could you verify for me if the following sizes are normal with these shop details:

    14K Orders
    500 review comments

    wp_postmeta: 890K records – 113MB
    wp_comments: 86K records – 35MB
    wp_woocommerce_order_itemmeta: 307K records – 36MB

    wp_comments is bloaded with order_notes and wp_postmeta is currently creating for each order 65 records. It’s a simple shop with 10 products and each 2 variants (so around 20 products).

    • This reply was modified 1 year ago by Demian.
    Plugin Support Phillip C.

    (@phillipwoo)

    Hi @demian85,

    In your site Dashboard, please navigate to WooCommerce → Status → Tools tab. From there you should see the first two options are for clearing transients in your site. Please use these tools and test to see if the issue is resolved.

    https://cld.wthms.co/2Daq8H

    I would also recommend scrolling about halfway down and use the Clear Customer Sessions tool as well.

    https://cld.wthms.co/GmDds6

    Please give this method a try and let us know if it fixes this issue.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Transient customer_bought_product problem’ is closed to new replies.