Query time 0.00467
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "328.45"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "cscart_categories",
"access_type": "const",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 1,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.10",
"prefix_cost": "0.00",
"data_read_per_join": "4K"
},
"used_columns": [
"category_id",
"usergroup_ids"
]
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 664,
"rows_produced_per_join": 664,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "4.39",
"eval_cost": "66.40",
"prefix_cost": "70.79",
"data_read_per_join": "10K"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_parent_product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dbggbern.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 72,
"filtered": "10.87",
"cost_info": {
"read_cost": "166.00",
"eval_cost": "7.22",
"prefix_cost": "303.19",
"data_read_per_join": "368K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"usergroup_ids",
"parent_product_id",
"pos_availabilty"
],
"attached_condition": "((`dbggbern`.`products`.`parent_product_id` = 0) and (`dbggbern`.`products`.`pos_availabilty` in ('S','N')) and ((`dbggbern`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`dbggbern`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`dbggbern`.`products`.`usergroup_ids`))) and (`dbggbern`.`products`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "descr1",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"product_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"lang_code"
],
"key_length": "9",
"ref": [
"dbggbern.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 72,
"filtered": "100.00",
"cost_info": {
"read_cost": "18.04",
"eval_cost": "7.22",
"prefix_cost": "328.45",
"data_read_per_join": "275K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
}
]
}
}
}
}
Result
| product_id |
product_type |
parent_product_id |
| 4241 |
P |
0 |
| 3635 |
P |
0 |
| 3052 |
P |
0 |
| 3634 |
P |
0 |
| 3053 |
P |
0 |
| 5844 |
P |
0 |
| 6034 |
P |
0 |
| 6035 |
P |
0 |
| 6037 |
P |
0 |
| 6700 |
P |
0 |
| 5896 |
P |
0 |
| 5889 |
P |
0 |
| 5894 |
P |
0 |
| 5893 |
P |
0 |
| 5897 |
P |
0 |
| 5891 |
P |
0 |
| 5899 |
P |
0 |
| 6096 |
P |
0 |
| 6087 |
P |
0 |
| 6088 |
P |
0 |
| 6092 |
P |
0 |
| 5883 |
P |
0 |
| 5888 |
P |
0 |
| 5884 |
P |
0 |
| 5885 |
P |
0 |
| 5886 |
P |
0 |
| 5887 |
P |
0 |
| 7241 |
P |
0 |
| 6743 |
P |
0 |
| 1764 |
P |
0 |
| 1765 |
P |
0 |
| 1767 |
P |
0 |
| 1763 |
P |
0 |
| 3550 |
P |
0 |
| 5064 |
P |
0 |
| 1672 |
P |
0 |
| 1667 |
P |
0 |
| 1769 |
P |
0 |
| 1666 |
P |
0 |
| 1669 |
P |
0 |
| 4063 |
P |
0 |
| 1671 |
P |
0 |
| 2986 |
P |
0 |
| 7213 |
P |
0 |
| 7211 |
P |
0 |
| 7212 |
P |
0 |
| 1513 |
P |
0 |
| 1516 |
P |
0 |