Query time 0.00199
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "91.03"
},
"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": 104,
"rows_produced_per_join": 104,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (36,1046,3332,40,1206,1734,5800,5799,7190,7189,5032,5033,6645,6644,4352,5391,5392,6767,6766,4799,4723,4724,7774,7757))",
"cost_info": {
"read_cost": "42.41",
"eval_cost": "10.40",
"prefix_cost": "52.81",
"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": 5,
"filtered": "5.00",
"cost_info": {
"read_cost": "26.00",
"eval_cost": "0.52",
"prefix_cost": "89.21",
"data_read_per_join": "20K"
},
"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": 5,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.30",
"eval_cost": "0.52",
"prefix_cost": "91.03",
"data_read_per_join": "83"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 36 |
23,9M |
0 |
| 40 |
23,9M |
0 |
| 1046 |
23,9M |
0 |
| 1206 |
23,9M |
0 |
| 1734 |
23,9M |
0 |
| 3332 |
23,9M |
0 |
| 4352 |
327,7,9,325M |
0 |
| 4723 |
9,25,7M |
0 |
| 4724 |
9,25,7M |
0 |
| 4799 |
9,25,7M |
0 |
| 5032 |
7,454,276,9,325M |
0 |
| 5033 |
7,454,276,9,325M |
0 |
| 5391 |
495,9,331,329,7,325M |
0 |
| 5392 |
495,9,331,329,7,325M |
0 |
| 5799 |
7,331,9,329,521,325M |
0 |
| 5800 |
7,331,9,329,521,325M |
0 |
| 6644 |
331,582,7,9,325M |
0 |
| 6645 |
331,582,7,9,325M |
0 |
| 6766 |
9,7,8,182,349,39,29M |
0 |
| 6767 |
182,7,349,8,9,29M |
0 |
| 7189 |
641,9,7,331,325M |
0 |
| 7190 |
641,9,7,331,325M |
0 |
| 7757 |
9,25,7M |
0 |
| 7774 |
9,25,7M |
0 |