Query time 0.00141
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "44.62"
},
"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": 30,
"rows_produced_per_join": 30,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.34",
"eval_cost": "3.00",
"prefix_cost": "6.34",
"data_read_per_join": "480"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
],
"attached_condition": "(`cscart_db`.`cscart_products_categories`.`product_id` in (69458,68914,68936,69401,68933,68935,68903,68913,68893,68889,68924,69486,68911,69380,68909))"
}
},
{
"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": 30,
"filtered": "100.00",
"cost_info": {
"read_cost": "24.78",
"eval_cost": "3.00",
"prefix_cost": "34.12",
"data_read_per_join": "480"
},
"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": 24,
"filtered": "81.96",
"cost_info": {
"read_cost": "7.50",
"eval_cost": "2.46",
"prefix_cost": "44.62",
"data_read_per_join": "68K"
},
"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 |
| 68889 |
2330,3007M |
|
| 68893 |
2330,3007M |
|
| 68903 |
2330,3007M |
|
| 68909 |
2330,3007M |
|
| 68911 |
2330,3007M |
|
| 68913 |
2330,3007M |
|
| 68914 |
2330,3007M |
|
| 68924 |
2330,3007M |
|
| 68933 |
2330,3007M |
|
| 68935 |
2330,3007M |
|
| 68936 |
2330,3007M |
|
| 69380 |
2330,2732M |
|
| 69401 |
2330,3007M |
|
| 69458 |
2330,2734M |
|
| 69486 |
2330,3018M |
|