Query time 0.00111
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "157.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 (34239,34249,34250,34262,34349,34469,34487,34538,2464,2465,2466,2467,2469,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1191,1011,1010,1009,999,998,997,975,958))",
"cost_info": {
"read_cost": "71.61",
"eval_cost": "6.60",
"prefix_cost": "78.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": "117.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": "157.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 |
958 |
131M |
|
975 |
130M |
|
997 |
130M |
|
998 |
130M |
|
999 |
130M |
|
1009 |
130M |
|
1010 |
130M |
|
1011 |
130M |
|
1175 |
130,11M |
0 |
1176 |
130,11M |
0 |
1177 |
130M |
|
1178 |
130M |
|
1179 |
131M |
|
1180 |
131M |
|
1181 |
130M |
|
1182 |
130M |
|
1183 |
130M |
|
1184 |
11M |
0 |
1191 |
11M |
0 |
2464 |
131,130M |
|
2465 |
130M |
|
2466 |
130M |
|
2467 |
130M |
|
2469 |
130M |
|
34239 |
131,130M |
|
34249 |
132M |
|
34250 |
132M |
|
34262 |
11M |
0 |
34349 |
133M |
|
34469 |
523M |
|
34487 |
523M |
|
34538 |
133M |
|