scherepanov icon

Untitled

scherepanov | PRO | 06/24/19 03:43:19 PM UTC | 0 ⭐ | 483 👁️ | Never ⏰ | []
text |

9.24 KB

|

None

|

0 👍

/

0 👎

mysql> EXPLAIN SELECT `e`.*, CONCAT(IF(e.prefix IS NOT NULL AND e.prefix != '', CONCAT(LTRIM(RTRIM(e.prefix)), ' '), ''), LTRIM(RTRIM(e.firstname)), ' ', IF(e.middlename IS NOT NULL AND e.middlename != '', CONCAT(LTRIM(RTRIM(e.middlename)), ' '), ''), LTRIM(RTRIM(e.lastname)), IF(e.suffix IS NOT NULL AND e.suffix != '', CONCAT(' ', LTRIM(RTRIM(e.suffix))), '')) AS `name`, `at_billing_postcode`.`postcode` AS `billing_postcode`, `at_billing_city`.`city` AS `billing_city`, `at_billing_telephone`.`telephone` AS `billing_telephone`, `at_billing_region`.`region` AS `billing_region`, `at_billing_country_id`.`country_id` AS `billing_country_id` FROM `customer_entity` AS `e`
    ->  LEFT JOIN `customer_address_entity` AS `at_billing_postcode` ON (`at_billing_postcode`.`entity_id` = `e`.`default_billing`)
    ->  LEFT JOIN `customer_address_entity` AS `at_billing_city` ON (`at_billing_city`.`entity_id` = `e`.`default_billing`)
    ->  LEFT JOIN `customer_address_entity` AS `at_billing_telephone` ON (`at_billing_telephone`.`entity_id` = `e`.`default_billing`)
    ->  LEFT JOIN `customer_address_entity` AS `at_billing_region` ON (`at_billing_region`.`entity_id` = `e`.`default_billing`)
    ->  LEFT JOIN `customer_address_entity` AS `at_billing_country_id` ON (`at_billing_country_id`.`entity_id` = `e`.`default_billing`) WHERE (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) AND (e.entity_id IN(SELECT `magento_customersegment_customer`.`customer_id` FROM `magento_customersegment_customer` WHERE (segment_id IN('50')) AND (e.entity_id = customer_id))) LIMIT 1000 OFFSET 8000;
+----+-------------+----------------------------------+--------+--------------------------------------------------------------------------------------------------------+---------+---------+------------------------------------------------------------+---------+----------------------------------------------------+
| id | select_type | table                            | type   | possible_keys                                                                                          | key     | key_len | ref                                                        | rows    | Extra                                              |
+----+-------------+----------------------------------+--------+--------------------------------------------------------------------------------------------------------+---------+---------+------------------------------------------------------------+---------+----------------------------------------------------+
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 4       | const                                                      |  318210 | Using index; Start temporary                       |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | magento_customersegment_customer | ref    | PRIMARY,MAGENTO_CSTRSEGMENT_CSTR_SEGMENT_ID_WS_ID_CSTR_ID,MAGENTO_CUSTOMERSEGMENT_CUSTOMER_CUSTOMER_ID | PRIMARY | 8       | const,DHCProd.magento_customersegment_customer.customer_id |       1 | Using index                                        |
|  1 | SIMPLE      | e                                | eq_ref | PRIMARY                                                                                                | PRIMARY | 4       | DHCProd.magento_customersegment_customer.customer_id       |       1 | End temporary                                      |
|  1 | SIMPLE      | at_billing_postcode              | ALL    | PRIMARY                                                                                                | NULL    | NULL    | NULL                                                       | 1081397 | Using where; Using join buffer (Block Nested Loop) |
|  1 | SIMPLE      | at_billing_city                  | eq_ref | PRIMARY                                                                                                | PRIMARY | 4       | DHCProd.e.default_billing                                  |       1 | NULL                                               |
|  1 | SIMPLE      | at_billing_telephone             | eq_ref | PRIMARY                                                                                                | PRIMARY | 4       | DHCProd.e.default_billing                                  |       1 | NULL                                               |
|  1 | SIMPLE      | at_billing_region                | eq_ref | PRIMARY                                                                                                | PRIMARY | 4       | DHCProd.e.default_billing                                  |       1 | NULL                                               |
|  1 | SIMPLE      | at_billing_country_id            | eq_ref | PRIMARY                                                                                                | PRIMARY | 4       | DHCProd.e.default_billing                                  |       1 | NULL                                               |
+----+-------------+----------------------------------+--------+--------------------------------------------------------------------------------------------------------+---------+---------+------------------------------------------------------------+---------+----------------------------------------------------+
16 rows in set (0.00 sec)

Comments