Query time 0.00089
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "139.21"
},
"grouping_operation": {
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "q_products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 29,
"rows_produced_per_join": 29,
"filtered": "100.00",
"index_condition": "(`portal`.`q_products_categories`.`product_id` in (44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,2,3,4,5,6,7,8,9,11,12,13))",
"cost_info": {
"read_cost": "63.81",
"eval_cost": "5.80",
"prefix_cost": "69.61",
"data_read_per_join": "464"
},
"used_columns": [
"product_id",
"category_id",
"link_type"
]
}
},
{
"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",
"portal.q_products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 29,
"filtered": "100.00",
"cost_info": {
"read_cost": "29.00",
"eval_cost": "5.80",
"prefix_cost": "104.41",
"data_read_per_join": "464"
},
"used_columns": [
"product_id",
"category_id",
"position"
]
}
},
{
"table": {
"table_name": "q_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"portal.q_products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 5,
"filtered": "20.00",
"cost_info": {
"read_cost": "29.00",
"eval_cost": "1.16",
"prefix_cost": "139.21",
"data_read_per_join": "15K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`portal`.`q_categories`.`usergroup_ids` = '') or find_in_set(0,`portal`.`q_categories`.`usergroup_ids`) or find_in_set(1,`portal`.`q_categories`.`usergroup_ids`)) and (`portal`.`q_categories`.`status` in ('A','H')))"
}
}
]
}
}
}
Result
product_id |
category_ids |
position |
2 |
5M |
|
3 |
5M |
|
4 |
5M |
|
5 |
5M |
|
6 |
5M |
|
7 |
5M |
|
8 |
5M |
|
9 |
5M |
|
11 |
5M |
|
12 |
5M |
|
13 |
5M |
|
44 |
5M |
|
45 |
5M |
|
46 |
5M |
|
47 |
4M |
|
48 |
4M |
|
49 |
5M |
|
50 |
4M |
|
51 |
5M |
|
52 |
4M |
|
53 |
4M |
|
54 |
4M |
|
55 |
4M |
|
56 |
4M |
|
57 |
5M |
|
58 |
5M |
|
59 |
5M |
|
60 |
4M |
|
61 |
4M |
|