Reducing Database Query Time

While there are specific MySQL tuning options available, and of course the possibility of moving your database to a dedicated server; ultimately the issue is the way WooCommerce handles variations. WooCommerce itself warns about the impact of performance when creating variations, you even have to confirm your choice when creating variable products.

So first off I’d look at the variety of product customizers available for WooCommerce. Most of them do not actually create variations in the true WooCommerce sense, so there typically is far less MySQL overhead for the product.

Secondly, I’d review the product variations with an eye to data normalization. Can you present the products in a better structure that will reduce the number of variations required for a given product?

Typically I see that store admins tend to over complicate the product. If they are selling a T-shirt in both men’s and women’s cuts, multiple sizes and multiple colors they tend to treat it as a single product which creates far too many variations.

For example a single T-shirt available in (Men’s or Women’s), size (Small, Medium, Large, X-Large), color (Red, Blue, Green) creates a single product with 24 permutations/variations. Displaying, updating, or creating the product involves 25 different records; the parent record and each of the various records.

Creating two different products (i.e. Men’s and Women’s) reduces the total overhead to only 13 records for each product. Greatly limiting the overhead for each product.

Obviously, this is a very simplified example but it does demonstrate the principle and the impact it has on performance.