Query time 0.00145
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "73.65"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "8.64"
},
"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": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 54,
"rows_produced_per_join": 8,
"filtered": "10.00",
"index_condition": "(`gaseus`.`cscart_products_categories`.`product_id` in (10421,10422,10423,10424,10425,10426,10427,10428,10429,10430,10431,10432,10433,10434,10435,10436,10437,10438,10439,10440,10441,10442,10443,10444,10445,10446,10447,10448,10449,10450,10451,10452,10453,10454,10455,10456,10457,10458,10459,10460,10461,10462,10463,10464,10465,10466,10467,10468))",
"using_join_buffer": "hash join",
"cost_info": {
"read_cost": "49.46",
"eval_cost": "0.86",
"prefix_cost": "62.80",
"data_read_per_join": "138"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`gaseus`.`cscart_products_categories`.`category_id` = `gaseus`.`cscart_categories`.`category_id`)"
}
},
{
"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",
"gaseus.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 8,
"filtered": "100.00",
"cost_info": {
"read_cost": "1.35",
"eval_cost": "0.86",
"prefix_cost": "65.01",
"data_read_per_join": "138"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 10421 |
306M |
|
| 10422 |
306M |
|
| 10423 |
306M |
|
| 10424 |
306M |
|
| 10425 |
306M |
|
| 10426 |
306M |
|
| 10427 |
306M |
|
| 10428 |
306M |
|
| 10429 |
306M |
|
| 10430 |
306M |
|
| 10431 |
306M |
|
| 10432 |
306M |
|
| 10433 |
306M |
|
| 10434 |
306M |
|
| 10435 |
306M |
|
| 10436 |
306M |
|
| 10437 |
306M |
|
| 10438 |
306M |
|
| 10439 |
306M |
|
| 10440 |
306M |
|
| 10441 |
306M |
|
| 10442 |
306M |
|
| 10443 |
306M |
|
| 10444 |
306M |
|
| 10445 |
306M |
|
| 10446 |
306M |
|
| 10447 |
306M |
|
| 10448 |
306M |
|
| 10449 |
306M |
|
| 10450 |
306M |
|
| 10451 |
306M |
|
| 10452 |
306M |
|
| 10453 |
306M |
|
| 10454 |
306M |
|
| 10455 |
306M |
|
| 10456 |
306M |
|
| 10457 |
306M |
|
| 10458 |
306M |
|
| 10459 |
306M |
|
| 10460 |
306M |
|
| 10461 |
306M |
|
| 10462 |
306M |
|
| 10463 |
306M |
|
| 10464 |
306M |
|
| 10465 |
306M |
|
| 10466 |
306M |
|
| 10467 |
306M |
|
| 10468 |
306M |
|