Query time 0.00128
JSON explain
{
"query_block": {
"select_id": 1,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "ALL",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"rows": 7,
"filtered": 100,
"attached_condition": "((`_testcscart`.`cscart_categories`.`company_id` = 1) and ((`_testcscart`.`cscart_categories`.`usergroup_ids` = '') or find_in_set(0,`_testcscart`.`cscart_categories`.`usergroup_ids`) or find_in_set(1,`_testcscart`.`cscart_categories`.`usergroup_ids`)) and (`_testcscart`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "cscart_products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"_testcscart.cscart_categories.category_id"
],
"rows": 1,
"filtered": 100,
"index_condition": "(`_testcscart`.`cscart_products_categories`.`product_id` in (7,6,5,4,3,2,1))"
}
},
{
"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",
"_testcscart.cscart_products_categories.product_id"
],
"rows": 1,
"filtered": 100
}
}
]
}
}
}
Result
| product_id |
category_ids |
position |
| 1 |
1M |
0 |
| 2 |
5M,3,1 |
0 |
| 3 |
5M,3,1 |
0 |
| 4 |
3M,1 |
0 |
| 5 |
1,5M |
0 |
| 6 |
1M |
0 |
| 7 |
1M |
0 |