Query time 0.75715
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "if(products.product_type = 'V',if(mccd__variation_stocks.parent_product_id is null,0,1),if(products.amount > 0,1,if(products.tracking = 'D',1,0))) desc, products.`timestamp` desc, products.product_id",
"temporary_table": {
"table": {
"table_name": "companies",
"access_type": "ALL",
"possible_keys": ["PRIMARY"],
"rows": 11,
"filtered": 100,
"attached_condition": "companies.`status` in ('A','S')"
},
"table": {
"table_name": "products",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_parent_product_id",
"idx_company_id"
],
"key": "idx_company_id",
"key_length": "4",
"used_key_parts": ["company_id"],
"ref": ["devmotorsbay.companies.company_id"],
"rows": 1190,
"filtered": 98.1960144,
"index_condition": "products.company_id in (1,3,5,6,7,8,10,11,12,13,15,0)",
"attached_condition": "products.parent_product_id = 0 and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A' and products.is_invoice = 'N' and products.product_type <> 'D'"
},
"table": {
"table_name": "mb_vehicle_listing_index",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["product_id"],
"ref": ["devmotorsbay.products.product_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(mb_vehicle_listing_index.product_id = products.product_id)"
},
"table": {
"table_name": "mb_recaon_visibility_case",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY"],
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["case_id"],
"ref": ["devmotorsbay.mb_vehicle_listing_index.case_id"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond((mb_recaon_visibility_case.case_id is null or mb_recaon_visibility_case.import_source not like 'recaon_%' or mb_vehicle_listing_index.storefront_id = 1) and (mb_recaon_visibility_case.case_id is null or mb_recaon_visibility_case.selected_flow <> 'direct_sale' or mb_recaon_visibility_case.sale_listing_status <> 'hold')) and trigcond(trigcond(mb_vehicle_listing_index.case_id is not null))"
},
"table": {
"table_name": "var_val_2",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"fl",
"variant_id",
"lang_code",
"product_id",
"fpl",
"idx_product_feature_variant_id"
],
"key": "PRIMARY",
"key_length": "15",
"used_key_parts": ["feature_id", "product_id", "variant_id", "lang_code"],
"ref": ["const", "devmotorsbay.products.product_id", "const", "const"],
"rows": 1,
"filtered": 5.998818398,
"attached_condition": "var_val_2.lang_code = 'en'",
"using_index": true
},
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["devmotorsbay.products.product_id"],
"rows": 1,
"filtered": 99.99243927,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)",
"using_index": true
},
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["devmotorsbay.products.product_id"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "c_status", "p_category_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["category_id"],
"ref": ["devmotorsbay.products_categories.category_id"],
"rows": 1,
"filtered": 100,
"index_condition": "cscart_categories.category_id in (499,528,503,530,533,546,548,515,514,525,537,524,534,550,516,527,545,551,517,523,538,544,553,539,547,554,540,518,531,541,519,526,542,552,562,543,549,521,535,522,532,536,529,558,559,560,561,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,606,607,630,631,632,633,634,635,637)",
"attached_condition": "(cscart_categories.usergroup_ids = '' or find_in_set(0,cscart_categories.usergroup_ids) or find_in_set(1,cscart_categories.usergroup_ids)) and cscart_categories.`status` in ('A','H') and cscart_categories.storefront_id in (0,1)"
},
"table": {
"table_name": "descr1",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "product_id", "idx_product_lang"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["product_id", "lang_code"],
"ref": ["devmotorsbay.products.product_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'en')"
},
"block-nl-join": {
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
"rows": 25,
"filtered": 100,
"attached_condition": "mccd__variation_stocks.parent_product_id = 0"
},
"buffer_type": "flat",
"buffer_size": "2048Kb",
"join_type": "BNL",
"attached_condition": "trigcond(mccd__variation_stocks.parent_product_id = 0)",
"materialized": {
"query_block": {
"select_id": 2,
"table": {
"table_name": "cscart_products",
"access_type": "range",
"possible_keys": ["idx_parent_product_id"],
"key": "idx_parent_product_id",
"key_length": "4",
"used_key_parts": ["parent_product_id"],
"rows": 26,
"filtered": 100,
"index_condition": "cscart_products.parent_product_id <> 0",
"attached_condition": "cscart_products.amount > 0 and cscart_products.product_type = 'V'"
}
}
}
},
"table": {
"table_name": "csc_product_currency_items",
"access_type": "eq_ref",
"possible_keys": ["product_id_company_id"],
"key": "product_id_company_id",
"key_length": "16",
"used_key_parts": ["product_id", "company_id"],
"ref": ["devmotorsbay.products.product_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(csc_product_currency_items.product_id = products.product_id)"
}
}
}
}
}
Result
| product_id |
product |
company_name |
cp_hash_template_as_timestamp_value |
product_type |
parent_product_id |
instock_marker |
instock_sorting |
currency |
amount |
purchase_qty |
is_invoice |
ei_order_id |
ei_status |
ei_for_user_id |
| 18717 |
Garnish assembly - right side of fender-87772G9500 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
52 |
N |
0 |
unpaid |
|
| 18718 |
Shield cover - front seat outer, right-88270G9130NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
27 |
N |
0 |
unpaid |
|
| 18719 |
Inside cover-front, right-88272G9100NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
28 |
N |
0 |
unpaid |
|
| 18720 |
screw-tapping-1241805103 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
38 |
N |
0 |
unpaid |
|
| 18721 |
Switch assembly - power front seat right-88640G9041NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
94 |
N |
0 |
unpaid |
|
| 18722 |
Housing-Front Cushion Tilt-88532J5000 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
44 |
N |
0 |
unpaid |
|
| 18723 |
Ventilation ECU-Front Seat-88554G9401 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
43 |
N |
0 |
unpaid |
|
| 18724 |
Duct - Front Cushion-88560G9030 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
68 |
N |
0 |
unpaid |
|
| 18725 |
Switch-WALK IN-88395G9000NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
56 |
N |
0 |
unpaid |
|
| 18726 |
Headrest Assembly - Front Seat-88700G9110XKH |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
83 |
N |
0 |
unpaid |
|
| 18727 |
Guide Assembly-W/O Headrest Lever-88722C5AB0NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
22 |
N |
0 |
unpaid |
|
| 18728 |
Guide assembly-headrest lever-88720C5AA0NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
39 |
N |
0 |
unpaid |
|
| 18729 |
top cover assembly-88365G9100NNB |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
45 |
N |
0 |
unpaid |
|
| 18730 |
Bolt-to-Front Seat Recliner Mounting-8819524000 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
4 |
N |
0 |
unpaid |
|
| 18731 |
Bolt-Washer Assembly-1198308303 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
53 |
N |
0 |
unpaid |
|
| 18732 |
Grommet-rear seat back mounting-89T90JI000 |
Motorsbay |
1716623750 |
P |
0 |
1 |
0 |
KRW |
0 |
52 |
N |
0 |
unpaid |
|