admin管理员组文章数量:1122832
on my WooCommerce website (I did test 3 themes xstore - flatsome - woodmart) when trying to browse product category page its take long time to load, I did use Query monitor to check my issue i found that
WP_Query->get_posts()
wp-includes/class-wp-query.php:3357
WP_Query->query()
wp-includes/class-wp-query.php:3852
WP->query_posts()
wp-includes/class-wp.php:696
WP->main()
wp-includes/class-wp.php:816
wp() wp-includes/functions.php:1336
Main Query
take time to load more than 33 sec
and this is the log at Query:
SELECT SQL_CALC_FOUND_ROWS mVkV6_posts.ID
FROM mVkV6_posts
LEFT JOIN mVkV6_term_relationships
ON (mVkV6_posts.ID = mVkV6_term_relationships.object_id)
INNER JOIN mVkV6_postmeta
ON ( mVkV6_posts.ID = mVkV6_postmeta.post_id )
INNER JOIN mVkV6_postmeta AS mt1
ON ( mVkV6_posts.ID = mt1.post_id )
WHERE 1=1
AND ( mVkV6_posts.ID NOT IN (
SELECT object_id
FROM mVkV6_term_relationships
WHERE term_taxonomy_id IN (7,9) )
AND mVkV6_term_relationships.term_taxonomy_id IN (366) )
AND ( ( mVkV6_postmeta.meta_key = '_price'
AND CAST(mVkV6_postmeta.meta_value AS SIGNED) != '' )
OR ( mt1.meta_key = '_price'
AND CAST(mt1.meta_value AS SIGNED) != '0' ) )
AND ((mVkV6_posts.post_type = 'product'
AND (mVkV6_posts.post_status = 'publish'
OR mVkV6_posts.post_status = 'wc-shipping'
OR mVkV6_posts.post_status = 'wc-shipped-status'
OR mVkV6_posts.post_status = 'private')))
GROUP BY mVkV6_posts.ID
ORDER BY mVkV6_posts.menu_order ASC, mVkV6_posts.post_title ASC
LIMIT 0, 12
本文标签: woocommerce offtopicWPQuerygtgetposts() take too long time to load data maybe 33 sec
版权声明:本文标题:woocommerce offtopic - WP_Query->get_posts() take too long time to load data maybe 33 sec 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736298028a1930140.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论