Query time 0.00135
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "20.70"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 36,
"rows_produced_per_join": 36,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.87",
"eval_cost": "3.60",
"prefix_cost": "7.47",
"data_read_per_join": "576"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`nuie_scalesta_net`.`cscart_products_categories`.`product_id` in (91476,82516,82544,89559,89569,87412,82515,87359,91475,82514,82511,89564,82485,82510,89555,82499,91473,82436,87381,85611,82497,91472,82495,91471,82498,89547,89533,82493,82435,87375))"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"nuie_scalesta_net.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "5.00",
"cost_info": {
"read_cost": "9.00",
"eval_cost": "0.18",
"prefix_cost": "20.07",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`nuie_scalesta_net`.`cscart_categories`.`storefront_id` in (0,1)) and ((`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`nuie_scalesta_net`.`cscart_categories`.`usergroup_ids`))) and (`nuie_scalesta_net`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"nuie_scalesta_net.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.45",
"eval_cost": "0.18",
"prefix_cost": "20.70",
"data_read_per_join": "28"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 82435 |
7173M |
|
| 82436 |
7173M |
|
| 82485 |
7172M |
|
| 82493 |
7174M |
|
| 82495 |
7174M |
|
| 82497 |
7174M |
|
| 82498 |
7174M |
|
| 82499 |
7174M |
|
| 82510 |
7165,7168,7177M |
0 |
| 82511 |
7177M |
|
| 82514 |
7165,7168,7177M |
0 |
| 82515 |
7177M |
|
| 82516 |
7165,7168,7177M |
0 |
| 82544 |
7176M |
|
| 85611 |
7169M |
|
| 87359 |
7173M |
|
| 87375 |
7173M |
|
| 87381 |
7173M |
|
| 87412 |
7174M |
|
| 89533 |
7172M |
|
| 89547 |
7175M |
|
| 89555 |
7177M |
|
| 89559 |
7177M |
|
| 89564 |
7179M |
|
| 89569 |
7176M |
|
| 91471 |
7174M |
|
| 91472 |
7174M |
|
| 91473 |
7174M |
|
| 91475 |
7177M |
|
| 91476 |
7177M |
|