Query time 0.00086
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "153.61"
},
"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": 32,
"rows_produced_per_join": 32,
"filtered": "100.00",
"index_condition": "(`portal`.`q_products_categories`.`product_id` in (9019,9020,9021,9022,9023,9024,9035,9036,9037,9038,9039,9040,9041,9042,9043,9044,9045,9061,9062,9063,9064,9065,9066,9067,9068,9069,9070,9086,9088,9124,9125,9126))",
"cost_info": {
"read_cost": "70.41",
"eval_cost": "6.40",
"prefix_cost": "76.81",
"data_read_per_join": "512"
},
"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": 32,
"filtered": "100.00",
"cost_info": {
"read_cost": "32.00",
"eval_cost": "6.40",
"prefix_cost": "115.21",
"data_read_per_join": "512"
},
"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": "32.00",
"eval_cost": "1.28",
"prefix_cost": "153.61",
"data_read_per_join": "16K"
},
"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 |
9019 |
418M |
|
9020 |
418M |
|
9021 |
418M |
|
9022 |
418M |
|
9023 |
418M |
|
9024 |
418M |
|
9035 |
418M |
|
9036 |
418M |
|
9037 |
418M |
|
9038 |
418M |
|
9039 |
418M |
|
9040 |
418M |
|
9041 |
418M |
|
9042 |
418M |
|
9043 |
418M |
|
9044 |
418M |
|
9045 |
418M |
|
9061 |
419M |
|
9062 |
419M |
|
9063 |
419M |
|
9064 |
419M |
|
9065 |
419M |
|
9066 |
419M |
|
9067 |
419M |
|
9068 |
419M |
|
9069 |
419M |
|
9070 |
419M |
|
9086 |
418M |
|
9088 |
419M |
|
9124 |
418M |
|
9125 |
419M |
|
9126 |
419M |
|