Query time 0.00459
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 |
| 36 |
P |
0 |
| 1046 |
P |
0 |
| 3332 |
P |
0 |
| 40 |
P |
0 |
| 1206 |
P |
0 |
| 1734 |
P |
0 |
| 5800 |
P |
0 |
| 5799 |
P |
0 |
| 7190 |
P |
0 |
| 7189 |
P |
0 |
| 5032 |
P |
0 |
| 5033 |
P |
0 |
| 6645 |
P |
0 |
| 6644 |
P |
0 |
| 4352 |
P |
0 |
| 5391 |
P |
0 |
| 5392 |
P |
0 |
| 6767 |
P |
0 |
| 6766 |
P |
0 |
| 4799 |
P |
0 |
| 4723 |
P |
0 |
| 4724 |
P |
0 |
| 7774 |
P |
0 |
| 7757 |
P |
0 |
| 3356 |
P |
0 |
| 5271 |
P |
0 |
| 5270 |
P |
0 |
| 5269 |
P |
0 |
| 5268 |
P |
0 |
| 4130 |
P |
0 |
| 4129 |
P |
0 |
| 4128 |
P |
0 |
| 4126 |
P |
0 |
| 4123 |
P |
0 |
| 4125 |
P |
0 |
| 4213 |
P |
0 |
| 4127 |
P |
0 |
| 4131 |
P |
0 |
| 4124 |
P |
0 |
| 1413 |
P |
0 |
| 1412 |
P |
0 |
| 1411 |
P |
0 |
| 1908 |
P |
0 |
| 1909 |
P |
0 |
| 4955 |
P |
0 |
| 4954 |
P |
0 |
| 4957 |
P |
0 |
| 4958 |
P |
0 |
| 7676 |
P |
0 |
| 7683 |
P |
0 |
| 7298 |
P |
0 |
| 7297 |
P |
0 |
| 5968 |
P |
0 |
| 2639 |
P |
0 |
| 5113 |
P |
0 |
| 7295 |
P |
0 |
| 7772 |
P |
0 |
| 7771 |
P |
0 |
| 7294 |
P |
0 |
| 7296 |
P |
0 |
| 2640 |
P |
0 |
| 7768 |
P |
0 |
| 7759 |
P |
0 |
| 7867 |
P |
0 |
| 7758 |
P |
0 |
| 7868 |
P |
0 |
| 2641 |
P |
0 |
| 7317 |
P |
0 |
| 7320 |
P |
0 |
| 7321 |
P |
0 |
| 2642 |
P |
0 |
| 5112 |
P |
0 |
| 3141 |
P |
0 |
| 7318 |
P |
0 |
| 3142 |
P |
0 |
| 2643 |
P |
0 |
| 3143 |
P |
0 |
| 7760 |
P |
0 |
| 7761 |
P |
0 |
| 7762 |
P |
0 |
| 3144 |
P |
0 |
| 5414 |
P |
0 |
| 5411 |
P |
0 |
| 5413 |
P |
0 |
| 5412 |
P |
0 |
| 5415 |
P |
0 |
| 4321 |
P |
0 |
| 4320 |
P |
0 |
| 4323 |
P |
0 |
| 4322 |
P |
0 |
| 4324 |
P |
0 |
| 4325 |
P |
0 |
| 4337 |
P |
0 |
| 4338 |
P |
0 |
| 4340 |
P |
0 |
| 4339 |
P |
0 |