MySQL Forums
Forum List  »  Performance

query performance optimization
Posted by: Devrishi Shandilya
Date: January 18, 2016 04:49AM

Hi Guys,
We have similar kind of lots of queries, which taking huge time (70-80 seconds) to execute, help us to optimize it,
1- Main culprit is sales_flat_order table, we need to pull data without filtering, all join field are indexed.

Whare are the best optimization strategy for this or this type of queries, where we need to scan huge data from table sales_flat_order.

SELECT SQL_CALC_FOUND_ROWS
SFO.entity_id AS order_id
,SFO.increment_id
,SFO.created_at
,GROUP_CONCAT(DISTINCT(SFOI.item_id))
,IFNULL(GROUP_CONCAT(DISTINCT(ts.state)),'') AS states
,VVV.company_name AS companyName
,VVV.first_name AS firstName
,VVV.vendor_id
,VVV.vendor_code
,IFNULL(SFOP.method,'')
,IFNULL(VVV.email,'')
,IFNULL(VVV.mobile_number,'')
,IFNULL(GROUP_CONCAT(DISTINCT(SOIT.id_tags)),'0') AS tags
,SOIT.updated_at AS rejection_date
,IFNULL(SFI.increment_id,'0') AS invoice_no
,IFNULL(SFS.shipment_code,'0') AS shipment_code
FROM sales_flat_order AS SFO
INNER JOIN sales_flat_order_payment SFOP ON SFO.entity_id=SFOP.parent_id
INNER JOIN sales_flat_order_item SFOI ON SFO.entity_id=SFOI.order_id
INNER JOIN catalog_product_entity_int CPEI ON CPEI.entity_id = SFOI.product_id AND CPEI.entity_type_id = 4
INNER JOIN sales_order_single_item SSI ON SSI.id_item= SFOI.item_id
INNER JOIN wms_tolexo_state_map tsm ON tsm.id_wms_state= SSI.id_wms_state
INNER JOIN tolexo_state ts ON ts.tolexo_state_id = tsm.id_seller_state
INNER JOIN vendor_vendordirectory_vendors VVV ON CPEI.value= VVV.vendor_id
LEFT JOIN sc_order_item_tags SOIT ON SOIT.id_item = SFOI.item_id
LEFT JOIN  seller_admin_map SAM ON SAM.seller_id = VVV.user_id
LEFT JOIN  sales_flat_invoice SFI ON SFI.order_id = SFO.entity_id
LEFT JOIN  sales_flat_shipment SFS ON SFS.order_id = SFO.entity_id
WHERE SSI.is_eligible_sc>0 AND (SAM.admin_user_id IS NULL OR SAM.admin_user_id='24577')
AND (CPEI.attribute_id=133) 
GROUP BY SFO.entity_id AND SOIT.id_tags IN (2,3,8,10,11,12) HAVING 1  AND FIND_IN_SET('PENDING' , states)  ORDER BY SFOI.created_at desc LIMIT 5


+----+-------------+-------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------+---------+-------------------------------+--------+----------------------------------------------------+
| id | select_type | table | type   | possible_keys                                                                                                                                       | key                                                            | key_len | ref                           | rows   | Extra                                              |
+----+-------------+-------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------+---------+-------------------------------+--------+----------------------------------------------------+
|  1 | SIMPLE      | SFO   | ALL    | PRIMARY                                                                                                                                             | NULL                                                           | NULL    | NULL                          | 463200 | Using temporary; Using filesort                    |
|  1 | SIMPLE      | SFOP  | ref    | IDX_SALES_FLAT_ORDER_PAYMENT_PARENT_ID                                                                                                              | IDX_SALES_FLAT_ORDER_PAYMENT_PARENT_ID                         | 4       | magento.SFO.entity_id         |      1 | NULL                                               |
|  1 | SIMPLE      | SFOI  | ref    | PRIMARY,IDX_SALES_FLAT_ORDER_ITEM_ORDER_ID                                                                                                          | IDX_SALES_FLAT_ORDER_ITEM_ORDER_ID                             | 4       | magento.SFO.entity_id         |      1 | Using where                                        |
|  1 | SIMPLE      | SOIT  | ref    | sc_order_item_tags_id_item                                                                                                                          | sc_order_item_tags_id_item                                     | 4       | magento.SFOI.item_id          |      1 | NULL                                               |
|  1 | SIMPLE      | SSI   | ref    | UNI_item_id_order_id_code,FK_sales_order_single_item_wms_state_wms_state_id                                                                         | UNI_item_id_order_id_code                                      | 5       | magento.SFOI.item_id          |      1 | Using index condition; Using where                 |
|  1 | SIMPLE      | tsm   | ref    | FK_wms_tolexo_state_map_wms_state_wms_state_id,FK_wms_tolexo_state_map_tolexo_state_seller_state_id                                                 | FK_wms_tolexo_state_map_wms_state_wms_state_id                 | 5       | magento.SSI.id_wms_state      |      1 | Using where                                        |
|  1 | SIMPLE      | ts    | eq_ref | PRIMARY                                                                                                                                             | PRIMARY                                                        | 4       | magento.tsm.id_seller_state   |      1 | NULL                                               |
|  1 | SIMPLE      | CPEI  | ref    | UNQ_CATALOG_PRODUCT_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID,IDX_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID,IDX_CATALOG_PRODUCT_ENTITY_INT_ENTITY_ID | UNQ_CATALOG_PRODUCT_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID | 6       | magento.SFOI.product_id,const |      1 | Using where                                        |
|  1 | SIMPLE      | VVV   | eq_ref | PRIMARY                                                                                                                                             | PRIMARY                                                        | 4       | magento.CPEI.value            |      1 | Using where                                        |
|  1 | SIMPLE      | SAM   | ALL    | FK_seller_admin_map_user                                                                                                                            | NULL                                                           | NULL    | NULL                          |      1 | Using where; Using join buffer (Block Nested Loop) |
|  1 | SIMPLE      | SFI   | ref    | IDX_SALES_FLAT_INVOICE_ORDER_ID                                                                                                                     | IDX_SALES_FLAT_INVOICE_ORDER_ID                                | 4       | magento.SFO.entity_id         |      1 | NULL                                               |
|  1 | SIMPLE      | SFS   | ref    | IDX_SALES_FLAT_SHIPMENT_ORDER_ID                                                                                                                    | IDX_SALES_FLAT_SHIPMENT_ORDER_ID                               | 4       | magento.SFO.entity_id         |      1 | NULL                                               |
+----+-------------+-------+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------+---------+-------------------------------+--------+----------------------------------------------------+




show create table sales_flat_order

CREATE TABLE `sales_flat_order` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `state` varchar(32) DEFAULT NULL COMMENT 'State',
  `status` varchar(32) DEFAULT NULL COMMENT 'Status',
  `coupon_code` varchar(255) DEFAULT NULL COMMENT 'Coupon Code',
  `protect_code` varchar(255) DEFAULT NULL COMMENT 'Protect Code',
  `shipping_description` varchar(255) DEFAULT NULL COMMENT 'Shipping Description',
  `is_virtual` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Virtual',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `base_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_discount_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Canceled',
  `base_discount_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Invoiced',
  `base_discount_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Refunded',
  `base_grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `base_shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `base_shipping_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Canceled',
  `base_shipping_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Invoiced',
  `base_shipping_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Refunded',
  `base_shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `base_shipping_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Tax Refunded',
  `base_subtotal` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `base_subtotal_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Canceled',
  `base_subtotal_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Invoiced',
  `base_subtotal_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Refunded',
  `base_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `base_tax_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Canceled',
  `base_tax_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Invoiced',
  `base_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Refunded',
  `base_to_global_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `base_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `base_total_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Canceled',
  `base_total_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Invoiced',
  `base_total_invoiced_cost` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Invoiced Cost',
  `base_total_offline_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Offline Refunded',
  `base_total_online_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Online Refunded',
  `base_total_paid` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Paid',
  `base_total_qty_ordered` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Qty Ordered',
  `base_total_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Refunded',
  `discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Discount Amount',
  `discount_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Discount Canceled',
  `discount_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Discount Invoiced',
  `discount_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Discount Refunded',
  `grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Grand Total',
  `shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `shipping_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Canceled',
  `shipping_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Invoiced',
  `shipping_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Refunded',
  `shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `shipping_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Tax Refunded',
  `store_to_base_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `store_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `subtotal` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal',
  `subtotal_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Canceled',
  `subtotal_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Invoiced',
  `subtotal_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Refunded',
  `tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Amount',
  `tax_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Tax Canceled',
  `tax_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Tax Invoiced',
  `tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Tax Refunded',
  `total_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Total Canceled',
  `total_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Total Invoiced',
  `total_offline_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Total Offline Refunded',
  `total_online_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Total Online Refunded',
  `total_paid` decimal(12,4) DEFAULT NULL COMMENT 'Total Paid',
  `total_qty_ordered` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty Ordered',
  `total_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Total Refunded',
  `can_ship_partially` smallint(5) unsigned DEFAULT NULL COMMENT 'Can Ship Partially',
  `can_ship_partially_item` smallint(5) unsigned DEFAULT NULL COMMENT 'Can Ship Partially Item',
  `customer_is_guest` smallint(5) unsigned DEFAULT NULL COMMENT 'Customer Is Guest',
  `customer_note_notify` smallint(5) unsigned DEFAULT NULL COMMENT 'Customer Note Notify',
  `billing_address_id` int(11) DEFAULT NULL COMMENT 'Billing Address Id',
  `customer_group_id` smallint(6) DEFAULT NULL COMMENT 'Customer Group Id',
  `edit_increment` int(11) DEFAULT NULL COMMENT 'Edit Increment',
  `email_sent` smallint(5) unsigned DEFAULT NULL COMMENT 'Email Sent',
  `forced_shipment_with_invoice` smallint(5) unsigned DEFAULT NULL COMMENT 'Forced Do Shipment With Invoice',
  `payment_auth_expiration` int(11) DEFAULT NULL COMMENT 'Payment Authorization Expiration',
  `quote_address_id` int(11) DEFAULT NULL COMMENT 'Quote Address Id',
  `quote_id` int(11) DEFAULT NULL COMMENT 'Quote Id',
  `shipping_address_id` int(11) DEFAULT NULL COMMENT 'Shipping Address Id',
  `adjustment_negative` decimal(12,4) DEFAULT NULL COMMENT 'Adjustment Negative',
  `adjustment_positive` decimal(12,4) DEFAULT NULL COMMENT 'Adjustment Positive',
  `base_adjustment_negative` decimal(12,4) DEFAULT NULL COMMENT 'Base Adjustment Negative',
  `base_adjustment_positive` decimal(12,4) DEFAULT NULL COMMENT 'Base Adjustment Positive',
  `base_shipping_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Discount Amount',
  `base_subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Incl Tax',
  `base_total_due` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Due',
  `payment_authorization_amount` decimal(12,4) DEFAULT NULL COMMENT 'Payment Authorization Amount',
  `shipping_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Discount Amount',
  `subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `total_due` decimal(12,4) DEFAULT NULL COMMENT 'Total Due',
  `weight` decimal(12,4) DEFAULT NULL COMMENT 'Weight',
  `customer_dob` datetime DEFAULT NULL COMMENT 'Customer Dob',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `applied_rule_ids` varchar(255) DEFAULT NULL COMMENT 'Applied Rule Ids',
  `base_currency_code` varchar(3) DEFAULT NULL COMMENT 'Base Currency Code',
  `customer_email` varchar(255) DEFAULT NULL COMMENT 'Customer Email',
  `customer_firstname` varchar(255) DEFAULT NULL COMMENT 'Customer Firstname',
  `customer_lastname` varchar(255) DEFAULT NULL COMMENT 'Customer Lastname',
  `customer_middlename` varchar(255) DEFAULT NULL COMMENT 'Customer Middlename',
  `customer_prefix` varchar(255) DEFAULT NULL COMMENT 'Customer Prefix',
  `customer_suffix` varchar(255) DEFAULT NULL COMMENT 'Customer Suffix',
  `customer_taxvat` varchar(255) DEFAULT NULL COMMENT 'Customer Taxvat',
  `discount_description` varchar(255) DEFAULT NULL COMMENT 'Discount Description',
  `ext_customer_id` varchar(255) DEFAULT NULL COMMENT 'Ext Customer Id',
  `ext_order_id` varchar(255) DEFAULT NULL COMMENT 'Ext Order Id',
  `global_currency_code` varchar(3) DEFAULT NULL COMMENT 'Global Currency Code',
  `hold_before_state` varchar(255) DEFAULT NULL COMMENT 'Hold Before State',
  `hold_before_status` varchar(255) DEFAULT NULL COMMENT 'Hold Before Status',
  `order_currency_code` varchar(255) DEFAULT NULL COMMENT 'Order Currency Code',
  `original_increment_id` varchar(50) DEFAULT NULL COMMENT 'Original Increment Id',
  `relation_child_id` varchar(32) DEFAULT NULL COMMENT 'Relation Child Id',
  `relation_child_real_id` varchar(32) DEFAULT NULL COMMENT 'Relation Child Real Id',
  `relation_parent_id` varchar(32) DEFAULT NULL COMMENT 'Relation Parent Id',
  `relation_parent_real_id` varchar(32) DEFAULT NULL COMMENT 'Relation Parent Real Id',
  `remote_ip` varchar(255) DEFAULT NULL COMMENT 'Remote Ip',
  `shipping_method` varchar(255) DEFAULT NULL COMMENT 'Shipping Method',
  `store_currency_code` varchar(3) DEFAULT NULL COMMENT 'Store Currency Code',
  `store_name` varchar(255) DEFAULT NULL COMMENT 'Store Name',
  `x_forwarded_for` varchar(255) DEFAULT NULL COMMENT 'X Forwarded For',
  `customer_note` text COMMENT 'Customer Note',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `total_item_count` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Total Item Count',
  `customer_gender` int(11) DEFAULT NULL COMMENT 'Customer Gender',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  `shipping_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Hidden Tax Amount',
  `base_shipping_hidden_tax_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Hidden Tax Amount',
  `hidden_tax_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Invoiced',
  `base_hidden_tax_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Invoiced',
  `hidden_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Refunded',
  `base_hidden_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Refunded',
  `shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `coupon_rule_name` varchar(255) DEFAULT NULL COMMENT 'Coupon Sales Rule Name',
  `paypal_ipn_customer_notified` int(11) DEFAULT '0' COMMENT 'Paypal Ipn Customer Notified',
  `gift_message_id` int(11) DEFAULT NULL COMMENT 'Gift Message Id',
  `purchase_from` varchar(250) DEFAULT 'Main Website' COMMENT 'Purchase from App Or Website',
  `purchase_admin_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_ORDER_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_ORDER_STATUS` (`status`),
  KEY `IDX_SALES_FLAT_ORDER_STATE` (`state`),
  KEY `IDX_SALES_FLAT_ORDER_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_ORDER_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_ORDER_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_SALES_FLAT_ORDER_EXT_ORDER_ID` (`ext_order_id`),
  KEY `IDX_SALES_FLAT_ORDER_QUOTE_ID` (`quote_id`),
  KEY `IDX_SALES_FLAT_ORDER_UPDATED_AT` (`updated_at`),
  CONSTRAINT `FK_SALES_FLAT_ORDER_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `FK_SALES_FLAT_ORDER_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=649371 DEFAULT CHARSET=utf8 COMMENT='Sales Flat Order'





mysql> show index from sales_flat_order;
+------------------+------------+-----------------------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table            | Non_unique | Key_name                          | Seq_in_index | Column_name  | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+------------------+------------+-----------------------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| sales_flat_order |          0 | PRIMARY                           |            1 | entity_id    | A         |      576631 |     NULL | NULL   |      | BTREE      |         |               |
| sales_flat_order |          0 | UNQ_SALES_FLAT_ORDER_INCREMENT_ID |            1 | increment_id | A         |      576631 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_STATUS       |            1 | status       | A         |         104 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_STATE        |            1 | state        | A         |          20 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_STORE_ID     |            1 | store_id     | A         |           2 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_CREATED_AT   |            1 | created_at   | A         |      576631 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_CUSTOMER_ID  |            1 | customer_id  | A         |      144157 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_EXT_ORDER_ID |            1 | ext_order_id | A         |           2 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_QUOTE_ID     |            1 | quote_id     | A         |      576631 |     NULL | NULL   | YES  | BTREE      |         |               |
| sales_flat_order |          1 | IDX_SALES_FLAT_ORDER_UPDATED_AT   |            1 | updated_at   | A         |      576631 |     NULL | NULL   | YES  | BTREE      |         |               |
+------------------+------------+-----------------------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
10 rows in set (0.01 sec)



Edited 1 time(s). Last edit at 01/22/2016 12:42PM by Peter Brawley.

Options: ReplyQuote


Subject
Views
Written By
Posted
query performance optimization
2112
January 18, 2016 04:49AM
925
January 22, 2016 06:29PM
812
January 22, 2016 01:08PM
874
January 22, 2016 11:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.