Query time 0.00195
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "158.34"
},
"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": 179,
"rows_produced_per_join": 179,
"filtered": "100.00",
"index_condition": "(`dbggbern`.`cscart_products_categories`.`product_id` in (809,5139,5133,5132,5131,5140,6256,6257,6267,6259,6224,6226,6238,6246,6235,6242,6740,6244,6239,6241,6237,6208,6247,6738,6255,6243,6240,6737,6206,6252,6260,6258,6207,6209,6741,6266,6250,6269,6236,6268,4238,2756,4239,3913,3910,4619,3916,3898))",
"cost_info": {
"read_cost": "74.66",
"eval_cost": "17.90",
"prefix_cost": "92.56",
"data_read_per_join": "2K"
},
"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": 8,
"filtered": "5.00",
"cost_info": {
"read_cost": "44.75",
"eval_cost": "0.90",
"prefix_cost": "155.21",
"data_read_per_join": "35K"
},
"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": 8,
"filtered": "100.00",
"cost_info": {
"read_cost": "2.24",
"eval_cost": "0.90",
"prefix_cost": "158.34",
"data_read_per_join": "143"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 809 |
67,39,7M |
0 |
| 2756 |
176,10,7M |
0 |
| 3898 |
10,176,7M |
0 |
| 3910 |
10,176,7M |
0 |
| 3913 |
176,10,7M |
0 |
| 3916 |
176,10,7M |
0 |
| 4238 |
176,10,7M |
0 |
| 4239 |
176,10,7M |
0 |
| 4619 |
176,10,7M |
0 |
| 5131 |
10,176,178,175,7M |
0 |
| 5132 |
10,176,178,175,7M |
0 |
| 5133 |
10,176,178,175,7M |
0 |
| 5139 |
10,176,178,175,7M |
0 |
| 5140 |
10,176,178,175,7M |
0 |
| 6206 |
10,176,7M |
0 |
| 6207 |
10,176,7M |
0 |
| 6208 |
10,176,7M |
0 |
| 6209 |
10,176,7M |
0 |
| 6224 |
10,176,7M |
0 |
| 6226 |
10,176,7M |
0 |
| 6235 |
10,176,7M |
0 |
| 6236 |
10,176,7M |
0 |
| 6237 |
10,176,7M |
0 |
| 6238 |
10,176,7M |
0 |
| 6239 |
10,176,7M |
0 |
| 6240 |
10,176,7M |
0 |
| 6241 |
10,176,7M |
0 |
| 6242 |
10,176,7M |
0 |
| 6243 |
10,176,7M |
0 |
| 6244 |
10,176,7M |
0 |
| 6246 |
10,176,7M |
0 |
| 6247 |
10,176,7M |
0 |
| 6250 |
10,176,7M |
0 |
| 6252 |
10,176,7M |
0 |
| 6255 |
10,176,7M |
0 |
| 6256 |
10,176,7M |
0 |
| 6257 |
10,176,7M |
0 |
| 6258 |
10,176,7M |
0 |
| 6259 |
10,176,7M |
0 |
| 6260 |
10,176,7M |
0 |
| 6266 |
10,176,7M |
0 |
| 6267 |
10,176,7M |
0 |
| 6268 |
10,176,7M |
0 |
| 6269 |
10,176,7M |
0 |
| 6737 |
176,10,7M |
0 |
| 6738 |
10,176,7M |
0 |
| 6740 |
10,176,7M |
0 |
| 6741 |
10,176,7M |
0 |