From 40b9458f8db1d93cea7804b4cc5a6849ad7161cb Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Thu, 31 Jan 2019 10:54:55 +0100 Subject: [PATCH] Added indices for faster joins with customer table and filtering by order status. --- .../woocommerce-admin/includes/class-wc-admin-api-init.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/includes/class-wc-admin-api-init.php b/plugins/woocommerce-admin/includes/class-wc-admin-api-init.php index 90310357e8d..444822ae375 100644 --- a/plugins/woocommerce-admin/includes/class-wc-admin-api-init.php +++ b/plugins/woocommerce-admin/includes/class-wc-admin-api-init.php @@ -720,7 +720,9 @@ class WC_Admin_Api_Init { status varchar(200) NOT NULL, customer_id BIGINT UNSIGNED NOT NULL, PRIMARY KEY (order_id), - KEY date_created (date_created) + KEY date_created (date_created), + KEY customer_id (customer_id), + KEY status (status) ) $collate; CREATE TABLE {$wpdb->prefix}wc_order_product_lookup ( order_item_id BIGINT UNSIGNED NOT NULL,