• Resolved dynit

    (@dynit)


    Hello,

    One of our sites is really getting slowed with too many Woocommerce database queries. I checked via Query Monitor and just browsing through categories (on the default shop page with the post type archive for products) fires 5000+ database queries per page load. The site has 66 categories, about 600 products, 2200 variations, and 6 custom attributes per product. Single product pages are ‘only’ 150-300 queries each, no performance issue there.

    Running Woocommerce 3.5.5 , WordPress 5.1, on a superfast host with PHP 7.3.2 and MariaDB 10.2. Some performance boosted through caching (WP Rocket), but uncacheable pages take 5 seconds to load, which is actually not bad considering the number of database queries. But 5000+ queries is just too much.

    Changing themes to default (WP default or Storefront) didn’t help, nor did disabling all plugins except Woocommerce.

    Top Woocommerce queries being fired on the default shop page with the post type archive for products are:

    WP_Term_Query->get_terms() has 4.068 queries
    update_meta_cache() has 631 queries
    WP_Post::get_instance() has 379 queries
    WC_Data_Store_WP->read_meta() has 366 queries
    get_option() has 75 queries

    It looks similar to this issue:

    https://www.ads-software.com/support/topic/every-product-being-queried-by-wp_term_query-get_terms-on-every-page-load/

    Any advice please? It looks like too many -irrelevant- details are loaded.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Site being slowed by too many (5000+) database queries’ is closed to new replies.