Query time 0.00096
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "155.41"
},
"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": 33,
"rows_produced_per_join": 33,
"filtered": "100.00",
"index_condition": "(`portal`.`q_products_categories`.`product_id` in (29282,29283,29314,29341,29690,29694,29702,29799,30319,30339,30770,30781,30782,30783,30787,30794,30799,30815,30860,30873,30876,30899,30911,30920,30931,30937,30939,30943,30957,30972))",
"cost_info": {
"read_cost": "69.61",
"eval_cost": "6.60",
"prefix_cost": "76.21",
"data_read_per_join": "528"
},
"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": 33,
"filtered": "100.00",
"cost_info": {
"read_cost": "33.00",
"eval_cost": "6.60",
"prefix_cost": "115.81",
"data_read_per_join": "528"
},
"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": 6,
"filtered": "20.00",
"cost_info": {
"read_cost": "33.00",
"eval_cost": "1.32",
"prefix_cost": "155.41",
"data_read_per_join": "17K"
},
"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 |
29282 |
180M |
|
29283 |
183M |
|
29314 |
183M |
|
29341 |
169M |
|
29690 |
183M |
|
29694 |
183M |
|
29702 |
168M |
0 |
29799 |
529M |
|
30319 |
188M |
|
30339 |
529M |
|
30770 |
179M |
|
30781 |
183M |
|
30782 |
529M |
|
30783 |
183M |
|
30787 |
183M |
|
30794 |
529M |
|
30799 |
183M |
|
30815 |
529M |
|
30860 |
183M |
|
30873 |
183M |
|
30876 |
180M |
|
30899 |
183M |
|
30911 |
183M |
|
30920 |
183M |
|
30931 |
183M |
|
30937 |
183M |
|
30939 |
529M |
|
30943 |
183M |
|
30957 |
183M |
|
30972 |
180M |
|