Query time 0.00456
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 |
| 4341 |
P |
0 |
| 4342 |
P |
0 |
| 6036 |
P |
0 |
| 4347 |
P |
0 |
| 6369 |
P |
0 |
| 4344 |
P |
0 |
| 4345 |
P |
0 |
| 5303 |
P |
0 |
| 6050 |
P |
0 |
| 7351 |
P |
0 |
| 5304 |
P |
0 |
| 4348 |
P |
0 |