Query time 0.00180
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "45.07"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "4.46"
},
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows_examined_per_scan": 98,
"rows_produced_per_join": 3,
"filtered": "4.00",
"cost_info": {
"read_cost": "22.49",
"eval_cost": "0.78",
"prefix_cost": "23.28",
"data_read_per_join": "13K"
},
"used_columns": [
"category_id",
"storefront_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`danishecarter_latest`.`cscart_categories`.`storefront_id` in (0,1)) and ((`danishecarter_latest`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`danishecarter_latest`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`danishecarter_latest`.`cscart_categories`.`usergroup_ids`)) and (`danishecarter_latest`.`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": [
"danishecarter_latest.cscart_categories.category_id"
],
"rows_examined_per_scan": 3,
"rows_produced_per_join": 4,
"filtered": "37.96",
"index_condition": "(`danishecarter_latest`.`cscart_products_categories`.`product_id` in (515,514,513,512,511,510,509,508,507,506,505,504,503,502,501,499,500,498,497,496,495,494,493,492,491,490,489,488,487,486,485,484,483,482,481,480,479,478,477,476,475,474,473,472,471,470,469,468,467,466,465,464,463,462,461,460,459,458,457,456,455,454,453,452,451,450,449,448,447,446,445,444,443,442,441,440,439,438,437,436,435,434,433,432,431,430,428,429,426,427,425,420,421,422,423,424))",
"cost_info": {
"read_cost": "14.97",
"eval_cost": "0.89",
"prefix_cost": "40.60",
"data_read_per_join": "71"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
product_id |
category_ids |
420 |
296M |
421 |
296M |
422 |
296M |
423 |
296M |
424 |
296M |
425 |
302M |
426 |
303M |
427 |
302M |
428 |
303M |
429 |
303M |
430 |
303M |
431 |
303M |
432 |
302M |
433 |
296M |
434 |
297M |
435 |
297M |
436 |
297M |
437 |
306M |
438 |
301M |
439 |
305M |
440 |
301M |
441 |
296M |
442 |
305M |
443 |
295M |
444 |
302M |
445 |
302M |
446 |
305M |
447 |
305M |
448 |
303M |
449 |
305M |
450 |
303M |
451 |
303M |
452 |
305M |
453 |
304M |
454 |
305M |
455 |
297M |
456 |
303M |
457 |
305M |
458 |
305M |
459 |
305M |
460 |
304M |
461 |
305M |
462 |
305M |
463 |
304M |
464 |
302M |
465 |
302M |
466 |
303M |
467 |
302M |
468 |
302M |
469 |
305M |
470 |
303M |
471 |
303M |
472 |
302M |
473 |
303M |
474 |
303M |
475 |
303M |
476 |
305M |
477 |
302M |
478 |
302M |
479 |
302M |
480 |
302M |
481 |
303M |
482 |
306M |
483 |
305M |
484 |
303M |
485 |
302M |
486 |
303M |
487 |
302M |
488 |
302M |
489 |
303M |
490 |
303M |
491 |
303M |
492 |
302M |
493 |
303M |
494 |
296M |
495 |
296M |
496 |
297M |
497 |
297M |
498 |
297M |
499 |
297M |
500 |
297M |
501 |
297M |
502 |
297M |
503 |
297M |
504 |
297M |
505 |
297M |
506 |
297M |
507 |
297M |
508 |
297M |
509 |
297M |
510 |
297M |
511 |
297M |
512 |
297M |
513 |
297M |
514 |
297M |
515 |
297M |