Query time 0.00373
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "201.67"
},
"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": 232,
"rows_produced_per_join": 232,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (6763,6761,4583,4591,5943,4869,4870,4871,4882,4873,4880,4858,7105,7099,7085,7107,7083,7127,7131,7114,5780,5781,5589,6951,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": "93.21",
"eval_cost": "23.20",
"prefix_cost": "116.41",
"data_read_per_join": "3K"
},
"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": 11,
"filtered": "5.00",
"cost_info": {
"read_cost": "58.00",
"eval_cost": "1.16",
"prefix_cost": "197.61",
"data_read_per_join": "46K"
},
"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": 11,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.90",
"eval_cost": "1.16",
"prefix_cost": "201.67",
"data_read_per_join": "185"
},
"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 |
| 4583 |
36,23,16M |
|
| 4591 |
9M |
|
| 4749 |
7,16,39,23M |
0 |
| 4858 |
401,1,28,49,23,7M |
0 |
| 4869 |
1,16,401,49,23,7M |
0 |
| 4870 |
1,167,401,49,23,7M |
0 |
| 4871 |
1,167,401,49,23,7M |
0 |
| 4873 |
1,167,401,49,23,7M |
0 |
| 4880 |
1,167,401,49,23,7M |
0 |
| 4882 |
1,167,401,49,23,7M |
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 |
| 5589 |
1,167,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 |
| 5780 |
1,8,49,349,509,23,7M |
0 |
| 5781 |
1,9,49,509,23,7M |
0 |
| 5782 |
1,167,49,23,7M |
0 |
| 5784 |
1,167,49,23,7M |
0 |
| 5866 |
23,8,349,182,7M |
0 |
| 5943 |
7,54,167,36M |
0 |
| 6033 |
7,23M |
0 |
| 6324 |
167,23,7M |
0 |
| 6387 |
7,54,167,36M |
0 |
| 6408 |
23,7,16,36M |
0 |
| 6761 |
23,54,9,36,7M |
0 |
| 6763 |
23,36,54,16,7M |
0 |
| 6951 |
39,7,23M |
0 |
| 7083 |
7,167,583,23M |
0 |
| 7085 |
167,583,7,23M |
0 |
| 7099 |
23,8,182,349,583,1,49,7M |
0 |
| 7105 |
23,8,182,349,583,1,49,7M |
0 |
| 7107 |
7,167,583,1,49,23M |
0 |
| 7114 |
7,167,583,1,49,23M |
0 |
| 7127 |
7,167,583,1,49,23M |
0 |
| 7131 |
7,167,583,1,49,23M |
0 |
| 7427 |
36,9,54,23,7M |
0 |
| 7641 |
23,8,182,349,7M |
0 |