Query time 0.00104
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "86.94"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 99,
"rows_produced_per_join": 99,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (6324,4579,4580,5419,5180,5420,5711,5714,5866,6033,5157,4749,5636,6408,7427,6387,4969,4968,5721,7641,2626,2627,5784,5782))",
"cost_info": {
"read_cost": "40.66",
"eval_cost": "9.90",
"prefix_cost": "50.56",
"data_read_per_join": "1K"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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": [
"dbggbern.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "5.00",
"cost_info": {
"read_cost": "24.75",
"eval_cost": "0.50",
"prefix_cost": "85.21",
"data_read_per_join": "19K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status",
"storefront_id"
],
"attached_condition": "((`dbggbern`.`cscart_categories`.`storefront_id` in (0,1)) and ((`dbggbern`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`dbggbern`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`dbggbern`.`cscart_categories`.`usergroup_ids`))) and (`dbggbern`.`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",
"dbggbern.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 4,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.24",
"eval_cost": "0.50",
"prefix_cost": "86.94",
"data_read_per_join": "79"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 2626 |
23,7,9M |
0 |
| 2627 |
7,23,9M |
0 |
| 4579 |
366,23,1,7M |
0 |
| 4580 |
366,23,1,7M |
0 |
| 4749 |
7,16,39,23M |
0 |
| 4968 |
36,16,54,23,7M |
0 |
| 4969 |
36,9,54,23,7M |
0 |
| 5157 |
1,167,440,23,7M |
0 |
| 5180 |
1,16,49,23,7M |
0 |
| 5419 |
1,16,49,23,7M |
0 |
| 5420 |
1,16,49,23,7M |
0 |
| 5636 |
16,39M |
|
| 5711 |
1,39,23,7M |
0 |
| 5714 |
1,9,49,23,7M |
0 |
| 5721 |
187,39,23,7M |
0 |
| 5782 |
1,167,49,23,7M |
0 |
| 5784 |
1,167,49,23,7M |
0 |
| 5866 |
23,8,349,182,7M |
0 |
| 6033 |
7,23M |
0 |
| 6324 |
167,23,7M |
0 |
| 6387 |
7,54,167,36M |
0 |
| 6408 |
23,7,16,36M |
0 |
| 7427 |
36,9,54,23,7M |
0 |
| 7641 |
23,8,182,349,7M |
0 |