Query time 0.00229
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "69.21"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "2.91"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 40,
"rows_produced_per_join": 1,
"filtered": "4.00",
"cost_info": {
"read_cost": "4.54",
"eval_cost": "0.16",
"prefix_cost": "4.70",
"data_read_per_join": "6K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`gaseus`.`cscart_categories`.`storefront_id` in (0,1)) and ((`gaseus`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`gaseus`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`gaseus`.`cscart_categories`.`usergroup_ids`))) and (`gaseus`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"gaseus.cscart_categories.category_id"
],
"rows_examined_per_scan": 110,
"rows_produced_per_join": 2,
"filtered": "1.65",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (11320,11321,11322,11323,11324,11325,11326,11327,11328,11329,11330,11331,11332,11333,11334,11335,11336,11337,11338,11339,11340,11341,11342,11343,11344,11345,11346,11347,11348,11349,11350,11351,11352,11353,11354,11355,11356,11357,11358,11359,11360,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11378,11379,11380,11381,11382,11383,11384,11385,11386,11387,11388,11389,11390,11391,11392,11393,11394,11395,11396,11397,11398,11399,11400,11401,11402,11403,11404,11405,11406,11407,11408,11409))",
"cost_info": {
"read_cost": "44.00",
"eval_cost": "0.29",
"prefix_cost": "66.30",
"data_read_per_join": "46"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
| 11320 |
306M |
| 11321 |
306M |
| 11322 |
306M |
| 11323 |
306M |
| 11324 |
306M |
| 11325 |
306M |
| 11326 |
306M |
| 11327 |
306M |
| 11328 |
306M |
| 11329 |
306M |
| 11330 |
306M |
| 11331 |
306M |
| 11332 |
306M |
| 11333 |
306M |
| 11334 |
306M |
| 11335 |
306M |
| 11336 |
306M |
| 11337 |
306M |
| 11338 |
306M |
| 11339 |
306M |
| 11340 |
306M |
| 11341 |
306M |
| 11342 |
306M |
| 11343 |
306M |
| 11344 |
306M |
| 11345 |
306M |
| 11346 |
306M |
| 11347 |
306M |
| 11348 |
306M |
| 11349 |
306M |
| 11350 |
306M |
| 11351 |
306M |
| 11352 |
306M |
| 11353 |
306M |
| 11354 |
306M |
| 11355 |
306M |
| 11356 |
306M |
| 11357 |
306M |
| 11358 |
306M |
| 11359 |
306M |
| 11360 |
306M |
| 11361 |
306M |
| 11362 |
306M |
| 11363 |
306M |
| 11364 |
306M |
| 11365 |
306M |
| 11366 |
306M |
| 11367 |
306M |
| 11368 |
306M |
| 11369 |
306M |
| 11370 |
306M |
| 11371 |
306M |
| 11372 |
306M |
| 11373 |
306M |
| 11374 |
306M |
| 11375 |
306M |
| 11376 |
306M |
| 11377 |
306M |
| 11378 |
306M |
| 11379 |
306M |
| 11380 |
306M |
| 11381 |
306M |
| 11382 |
306M |
| 11383 |
306M |
| 11384 |
306M |
| 11385 |
306M |
| 11386 |
306M |
| 11387 |
306M |
| 11388 |
306M |
| 11389 |
306M |
| 11390 |
306M |
| 11391 |
306M |
| 11392 |
306M |
| 11393 |
306M |
| 11394 |
306M |
| 11395 |
306M |
| 11396 |
306M |
| 11397 |
306M |
| 11398 |
306M |
| 11399 |
306M |
| 11400 |
306M |
| 11401 |
306M |
| 11402 |
306M |
| 11403 |
306M |
| 11404 |
306M |
| 11405 |
306M |
| 11406 |
306M |
| 11407 |
306M |
| 11408 |
306M |
| 11409 |
306M |