• This is timing after Checkout -> Order Received.
    Is it possible to speed these results from Query Monitor up which relate to GTM4WP? Combined they are taking almost 0.6 seconds

    I’ve dumped the relevant results below and added [QUERY —> …] to better readability.

    [QUERY --> 
    SELECT SUM(meta2.meta_value)
    FROM wp_posts as posts
    LEFT JOIN wp_postmeta AS meta
    ON posts.ID = meta.post_id
    LEFT JOIN wp_postmeta AS meta2
    ON posts.ID = meta2.post_id
    WHERE meta.meta_key = '_customer_user'
    AND meta.meta_value = '2'
    AND posts.post_type = 'shop_order'
    AND posts.post_status IN ( 'wc-processing','wc-completed' )
    AND meta2.meta_key = '_order_total']
    [ CALLER -->> WC_Customer_Data_Store->get_total_spent]
    [TIME --->>> 0.3022]
    
    [QUERY --> 
    163 SELECT COUNT(*)
    FROM wp_posts as posts
    LEFT JOIN wp_postmeta AS meta
    ON posts.ID = meta.post_id
    WHERE meta.meta_key = '_customer_user'
    AND posts.post_type = 'shop_order'
    AND posts.post_status IN ( 'wc-pending','wc-processing','wc-on-hold','wc-completed','wc-cancelled','wc-refunded','wc-failed','wc-partial-payment','wc-checkout-draft' )
    AND meta_value = '2']
    [ CALLER -->> WC_Customer_Data_Store->get_order_count
    WC_Data_Store->__call
    WC_Customer->get_order_count
    gtm4wp_woocommerce_datalayer_filter_items
    apply_filters('gtm4wp_compile_datalayer')
    gtm4wp_wp_header_begin
    do_action('wp_head')
    wp_head
    include('/plugins/oxygen/component-framework/oxygen-main-template.php')
    require_once('wp-includes/template-loader.php')
    require('wp-blog-header.php')]
    [TIME --->>> 0.2963]
  • The topic ‘Possible to Speed up query?’ is closed to new replies.