WP_Query->get_posts() Slow Query on Dashboard
-
Hi,
I am having a slow query from Woocommerce using Query Monitor. This happens on the dashboard page in admin. I am using Health Check & Troubleshooting plugin. Have disabled every plugin except Woocommerce and am on a default Twenty Twenty theme in troubleshooting mode. Below is the data show on Query Monitor:`SELECT wp_typosts.ID
FROM wp_typosts
LEFT JOIN wp_tyterm_relationships
ON (wp_typosts.ID = wp_tyterm_relationships.object_id)
INNER JOIN wp_typostmeta
ON ( wp_typosts.ID = wp_typostmeta.post_id )
WHERE 1=1
AND ( wp_tyterm_relationships.term_taxonomy_id IN (2,3,4,5) )
AND ( ( wp_typostmeta.meta_key = ‘_virtual’
AND wp_typostmeta.meta_value = ‘no’ ) )
AND wp_typosts.post_type = ‘product’
AND ((wp_typosts.post_status = ‘publish’
OR wp_typosts.post_status = ‘draft’
OR wp_typosts.post_status = ‘pending’
OR wp_typosts.post_status = ‘private’))
GROUP BY wp_typosts.ID
ORDER BY wp_typosts.post_date DESC
LIMIT 0, 1`Caller: WP_Query->get_posts()
WP_Query->get_posts() wp-includes/class-wp-query.php:3129 WP_Query->query() wp-includes/class-wp-query.php:3586 WP_Query->__construct() wp-includes/class-wp-query.php:3718 WC_Product_Data_Store_CPT->query() wp-content/plugins/woocommerce/includes/data-stores/class-wc-product-data-store-cpt.php:2042 WC_Data_Store->__call() wp-content/plugins/woocommerce/includes/class-wc-data-store.php:207 WC_Product_Query->get_products() wp-content/plugins/woocommerce/includes/class-wc-product-query.php:76 wc_get_products() wp-content/plugins/woocommerce/includes/wc-product-functions.php:48 Automattic\W\A\F\O\T\Shipping::has_physical_products() wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Shipping.php:114 Automattic\W\A\F\O\T\Shipping->can_view() wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/Tasks/Shipping.php:78 Automattic\W\A\F\O\TaskList->Automattic\W\A\F\O\{closure}() wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php:299 array_filter() wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php:299 Automattic\W\A\F\O\TaskList->get_viewable_tasks() wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php:300 Automattic\W\A\F\O\TaskList->is_complete() wp-content/plugins/woocommerce/src/Admin/Features/OnboardingTasks/TaskList.php:230 WC_Admin_Dashboard_Setup->should_display_widget() wp-content/plugins/woocommerce/includes/admin/class-wc-admin-dashboard-setup.php:190 WC_Admin_Dashboard_Setup->__construct() wp-content/plugins/woocommerce/includes/admin/class-wc-admin-dashboard-setup.php:50 WC_Admin->conditional_includes() wp-content/plugins/woocommerce/includes/admin/class-wc-admin.php:102 do_action('current_screen') wp-includes/plugin.php:476 WP_Screen->set_current_screen() wp-admin/includes/class-wp-screen.php:422 set_current_screen() wp-admin/includes/screen.php:243
Component woocommerce
Time 0.2387sThe current version of Woocommerce 6.7.0
Please let me know why the slow query? Is there also a fix for this? We were also wondering if this is related to high CPU spikes with admin-ajax.php and index.php on our servers as the front end does not display linkage to the mentioned file.
Thanks in advance
- The topic ‘WP_Query->get_posts() Slow Query on Dashboard’ is closed to new replies.