Query time 0.00087
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "41.66"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"link_type",
"pt",
"idx_product_category_lookup",
"idx_products_categories_composite"
],
"key": "idx_products_categories_composite",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 28,
"rows_produced_per_join": 28,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.14",
"eval_cost": "2.80",
"prefix_cost": "5.94",
"data_read_per_join": "448"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (68983,68984,68985,68986,68987,68988,68989,68990,68991,68992,68993,68994,68995,69216,69217))"
}
},
{
"table": {
"table_name": "product_position_source",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt",
"idx_product_category_lookup",
"idx_products_categories_composite"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"cscart_db.cscart_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 28,
"filtered": "100.00",
"cost_info": {
"read_cost": "23.12",
"eval_cost": "2.80",
"prefix_cost": "31.87",
"data_read_per_join": "448"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"p_category_id",
"idx_categories_storefront_status",
"idx_categories_usergroup_status",
"idx_categories_status_id_path"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"cscart_db.cscart_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 22,
"filtered": "81.96",
"cost_info": {
"read_cost": "7.00",
"eval_cost": "2.29",
"prefix_cost": "41.67",
"data_read_per_join": "64K"
},
"used_columns": [
"category_id",
"status",
"storefront_id"
],
"attached_condition": "((`cscart_db`.`cscart_categories`.`storefront_id` in (0,1)) and (`cscart_db`.`cscart_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 68983 |
2330,2734M |
|
| 68984 |
2330,2734M |
|
| 68985 |
2330,2734M |
|
| 68986 |
2330,2734M |
|
| 68987 |
2330,2734M |
|
| 68988 |
2330,2734M |
|
| 68989 |
2330,2734M |
|
| 68990 |
2330,3018M |
|
| 68991 |
2330,3018M |
|
| 68992 |
2330,3018M |
|
| 68993 |
2330,3018M |
|
| 68994 |
2330,3018M |
|
| 68995 |
2330,3018M |
|
| 69216 |
3018M |
|
| 69217 |
3018M |
|