Query time 0.00032
JSON explain
{
"query_block": {
"select_id": 1,
"cost": 0.165243857,
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "cscart_products_categories.product_id",
"table": {
"table_name": "cscart_products_categories",
"access_type": "ALL",
"possible_keys": ["PRIMARY", "pt"],
"loops": 1,
"rows": 138,
"cost": 0.03161949,
"filtered": 22.46376801,
"attached_condition": "cscart_products_categories.product_id in (135,136,137,138,139,140,141,142,143)"
}
}
}
},
{
"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": ["cscart.cscart_products_categories.category_id"],
"loops": 31,
"rows": 1,
"cost": 0.059948606,
"filtered": 100,
"attached_condition": "cscart_categories.storefront_id in (0,1) and (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')"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": ["PRIMARY", "pt"],
"key": "PRIMARY",
"key_length": "6",
"used_key_parts": ["category_id", "product_id"],
"ref": ["const", "cscart.cscart_products_categories.product_id"],
"loops": 31,
"rows": 1,
"cost": 0.053804606,
"filtered": 100
}
}
]
}
}
Result
product_id |
category_ids |
position |
135 |
43213M |
0 |
136 |
43213M |
0 |
137 |
43213M |
0 |
138 |
43213M |
0 |
139 |
43213M |
0 |
140 |
43213M |
0 |
141 |
43213M |
0 |
142 |
43213M |
0 |
143 |
43213M |
0 |