Query time 0.00114
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "45.62"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "5.02"
},
"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": 5,
"filtered": "42.67",
"index_condition": "(`danishecarter_latest`.`cscart_products_categories`.`product_id` in (423,424,455,433,495,453,468,467,418,420,421,422,406,407,437,494,454,442,426,429,428,410,438,440,443,463,460,450,446,447,476,457,482,483,472,441,405,403,485,492,479,480,413,401,449,474,473,448,493,409,404,456,469,431,466,402,439,484,470,490,451,491,411,486,458,459,461,462,471,425,427,416,419,464,465,432,444,445,477,478,487,488,434,435,515,481,489,415,430,414,475,452,412,417,503,514,496,497,499,512,436,498,507,513,500,511,501,502,510,506,509,508,505,504))",
"cost_info": {
"read_cost": "14.97",
"eval_cost": "1.00",
"prefix_cost": "40.60",
"data_read_per_join": "80"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
}
]
}
}
}
Result
product_id |
category_ids |
401 |
295M |
402 |
295M |
403 |
302M |
404 |
295M |
405 |
302M |
406 |
302M |
407 |
302M |
409 |
303M |
410 |
303M |
411 |
303M |
412 |
303M |
413 |
302M |
414 |
303M |
415 |
303M |
416 |
302M |
417 |
303M |
418 |
302M |
419 |
302M |
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 |