Query time 0.00605
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 |
| 4003 |
P |
0 |
| 4002 |
P |
0 |
| 4006 |
P |
0 |
| 4001 |
P |
0 |
| 4000 |
P |
0 |
| 4598 |
P |
0 |
| 2510 |
P |
0 |
| 2507 |
P |
0 |
| 2508 |
P |
0 |
| 2511 |
P |
0 |
| 2509 |
P |
0 |
| 3753 |
P |
0 |
| 489 |
P |
0 |
| 416 |
P |
0 |
| 3182 |
P |
0 |
| 3181 |
P |
0 |
| 494 |
P |
0 |
| 488 |
P |
0 |
| 492 |
P |
0 |
| 497 |
P |
0 |
| 495 |
P |
0 |
| 3656 |
P |
0 |
| 1610 |
P |
0 |
| 1606 |
P |
0 |
| 1608 |
P |
0 |
| 1609 |
P |
0 |
| 1676 |
P |
0 |
| 1675 |
P |
0 |
| 1607 |
P |
0 |
| 1677 |
P |
0 |
| 491 |
P |
0 |
| 1737 |
P |
0 |
| 1736 |
P |
0 |
| 100 |
P |
0 |
| 95 |
P |
0 |
| 6430 |
P |
0 |
| 6431 |
P |
0 |
| 7254 |
P |
0 |
| 7255 |
P |
0 |
| 4050 |
P |
0 |
| 4051 |
P |
0 |
| 4602 |
P |
0 |
| 4049 |
P |
0 |
| 4034 |
P |
0 |
| 4048 |
P |
0 |
| 4419 |
P |
0 |
| 4601 |
P |
0 |
| 4422 |
P |
0 |