Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5540

MYSQL problem with 5.5x update

$
0
0

Hi,

updating from 5.4.2 to WC 5.5.1 makes the mysql process to rocket up to 1200% – 1300% CPU usage.

these queries accumulate in the mysql processes:

SELECT SQL_CALC_FOUND_ROWS  fzpHHDKt_posts.*, low_stock_amount_meta.meta_value AS low_stock_amount, MAX( product_lookup.date_created ) AS last_order_date FROM fzpHHDKt_posts  LEFT JOIN fzpHHDKt_wc_product_meta_lookup wc_product_meta_lookup ON fzpHHDKt_posts.ID = wc_product_meta_lookup.product_id  LEFT JOIN fzpHHDKt_postmeta AS low_stock_amount_meta ON fzpHHDKt_posts.ID = low_stock_amount_meta.post_id AND low_stock_amount_meta.meta_key = '_low_stock_amount'  LEFT JOIN fzpHHDKt_wc_order_product_lookup product_lookup ON fzpHHDKt_posts.ID = CASE
				WHEN fzpHHDKt_posts.post_type = 'product' THEN product_lookup.product_id
				WHEN fzpHHDKt_posts.post_type = 'product_variation' THEN product_lookup.variation_id
			END WHERE 1=1  AND fzpHHDKt_posts.post_type IN ('product', 'product_variation') AND ((fzpHHDKt_posts.post_status = 'publish'))
			AND wc_product_meta_lookup.stock_quantity IS NOT NULL
			AND wc_product_meta_lookup.stock_status IN('instock','outofstock')
			AND (
				(
					low_stock_amount_meta.meta_value > ''
					AND wc_product_meta_lookup.stock_quantity <= CAST(low_stock_amount_meta.meta_value AS SIGNED)
				)
				OR (
					(
						low_stock_amount_meta.meta_value IS NULL OR low_stock_amount_meta.meta_value <= ''
					)
					AND wc_product_meta_lookup.stock_quantity <= 1
				)
			) GROUP BY fzpHHDKt_posts.ID ORDER BY fzpHHDKt_posts.post_date DESC, fzpHHDKt_posts.ID DESC LIMIT 0, 1

Reverting to 5.4.2 immediately solves the problem, and these queries do not show anymore in the mysql processes…


Viewing all articles
Browse latest Browse all 5540

Trending Articles