Query time 0.00057
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "16.22"
},
"nested_loop": [
{
"table": {
"table_name": "pc",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"rows_examined_per_scan": 27,
"rows_produced_per_join": 27,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "3.12",
"eval_cost": "2.70",
"prefix_cost": "5.82",
"data_read_per_join": "432"
},
"used_columns": [
"product_id",
"category_id"
],
"attached_condition": "((`CS_Cart_Dev`.`pc`.`category_id` in (340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,356,357,358,359,360,361,362,363,364,365,366)) and (`CS_Cart_Dev`.`pc`.`product_id` is not null))"
}
},
{
"table": {
"table_name": "c",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"CS_Cart_Dev.pc.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "10.00",
"cost_info": {
"read_cost": "6.75",
"eval_cost": "0.27",
"prefix_cost": "15.27",
"data_read_per_join": "10K"
},
"used_columns": [
"category_id",
"status"
],
"attached_condition": "(`CS_Cart_Dev`.`c`.`status` = 0)"
}
},
{
"table": {
"table_name": "p",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_parent_product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"CS_Cart_Dev.pc.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 2,
"filtered": "94.34",
"cost_info": {
"read_cost": "0.68",
"eval_cost": "0.25",
"prefix_cost": "16.22",
"data_read_per_join": "11K"
},
"used_columns": [
"product_id",
"status",
"parent_product_id"
],
"attached_condition": "((`CS_Cart_Dev`.`p`.`parent_product_id` = 0) and (`CS_Cart_Dev`.`p`.`status` = 'A'))"
}
}
]
}
}