FAQs

    Power tweaks

    Speed up WooCommerce’s “Get total spent” query

    This is one of two ‘Power Tweaks’ which are a feature of WP-Optimize Premium.

    When a customer places their first order, WooCommerce calculates the total spent by running a very slow query. This power tweak replaces this slow query with two separate and much more efficient queries.

    This will be especially effective on e-commerce websites containing large amounts of customers and orders.

    It uses the filterwoocommerce_customer_get_total_spent to calculate the total spent when the user meta _money_spent is not set.

    This issue has been reported to WooCommerce, but not addressed yet (See issue on Github).

     

    Index the meta_key in the postmeta table

    This is one of two ‘Power Tweaks’ which are a feature of WP-Optimize Premium. This power tweak works by ensuring the meta_key column in the WordPress postmeta table can be indexed.

    While the meta_key column appears to be indexed by default, the use of utf8mb4 limits the indexing of columns to a maximum of 191 characters. The meta_key column is 256 characters long and so can not be indexed.

    This power tweak changes the column size down to 191 characters where possible, allowing the column to be indexed which helps queries to run faster.