Query time 0.02666
JSON explain
{
"query_block": {
"select_id": 1,
"filesort": {
"sort_key": "products.product_id not in (12544,12545,12546,12547,12548,12549,12550,12552,12554,12555,12556,12557,12558,12559,12560,12561,12563,12564,12565,12566,12567,12568,12569,12570,12571,12572,12573,12574,12575,12576,12577,12578,12579,12580,12581,12582,12583,12584,12585,12586,12587,12588,12589,12590,12591,12592,12593,12594,12595,12597,12599,12601,12604,12605,12606,12608,12610,12618,12621,12622,12623,12624,12625,12626,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643,12644,12645,12646,12652,12654,12656,13091) desc, products.`timestamp` desc, products.product_id",
"temporary_table": {
"table": {
"table_name": "companies",
"access_type": "system",
"possible_keys": ["PRIMARY"],
"rows": 1,
"filtered": 100
},
"table": {
"table_name": "shared_descr",
"access_type": "system",
"possible_keys": ["PRIMARY", "product_id", "company_id"],
"rows": 0,
"filtered": 0,
"const_row_not_found": true
},
"table": {
"table_name": "prices",
"access_type": "index",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"key_length": "9",
"used_key_parts": ["product_id", "usergroup_id", "lower_limit"],
"rows": 1816,
"filtered": 99.94493103,
"attached_condition": "prices.lower_limit = 1 and prices.usergroup_id in (0,0,1)",
"using_index": true
},
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "status", "idx_parent_product_id"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.product_id"],
"rows": 1,
"filtered": 93.45071411,
"attached_condition": "products.parent_product_id = 0 and products.company_id = 1 and (products.amount > 0 or products.tracking = 'D') and (products.usergroup_ids = '' or find_in_set(0,products.usergroup_ids) or find_in_set(1,products.usergroup_ids)) and products.`status` = 'A'"
},
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "pt",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["noframes_angrybeaver.prices.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": ["noframes_angrybeaver.products_categories.category_id"],
"rows": 1,
"filtered": 100,
"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"],
"key": "PRIMARY",
"key_length": "9",
"used_key_parts": ["product_id", "lang_code"],
"ref": ["noframes_angrybeaver.prices.product_id", "const"],
"rows": 1,
"filtered": 100,
"attached_condition": "trigcond(descr1.lang_code = 'ru')"
}
}
}
}
}
Result
| product_id |
product |
company_name |
product_type |
parent_product_id |
| 12820 |
Morelli col.40 |
NoFrames |
P |
0 |
| 12821 |
Morelli col.07 |
NoFrames |
P |
0 |
| 12822 |
Morelli col.10 |
NoFrames |
P |
0 |
| 12983 |
Etno-mix stripe col.03 |
NoFrames |
P |
0 |
| 10176 |
Studio stripe col.15 |
NoFrames |
P |
0 |
| 12906 |
Studio plain col.10 |
NoFrames |
P |
0 |
| 12907 |
Studio plain col.13 |
NoFrames |
P |
0 |
| 12908 |
Studio plain col.15 |
NoFrames |
P |
0 |
| 12909 |
Studio stripe col.13 |
NoFrames |
P |
0 |
| 10174 |
Cordoba P5713 col.19000 |
NoFrames |
P |
0 |
| 12794 |
Cordoba P5713 col.15001 |
NoFrames |
P |
0 |
| 12795 |
Cordoba P5713 col.17001 |
NoFrames |
P |
0 |
| 12796 |
Cordoba P5713 col.29000 |
NoFrames |
P |
0 |
| 10172 |
Aleksandria col.12 |
NoFrames |
P |
0 |
| 12712 |
Bakus P6673 col.33701 |
NoFrames |
P |
0 |
| 12713 |
Bakus P6673 col.23001 |
NoFrames |
P |
0 |