Query time 0.05097
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1862.74"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "products",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"status",
"idx_parent_product_id"
],
"key": "status",
"used_key_parts": [
"status"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 3747,
"rows_produced_per_join": 749,
"filtered": "19.99",
"cost_info": {
"read_cost": "172.32",
"eval_cost": "74.92",
"prefix_cost": "547.03",
"data_read_per_join": "3M"
},
"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`))))"
}
},
{
"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.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 749,
"filtered": "100.00",
"cost_info": {
"read_cost": "187.30",
"eval_cost": "74.92",
"prefix_cost": "809.24",
"data_read_per_join": "2M"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "pt",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dbggbern.products.product_id"
],
"rows_examined_per_scan": 3,
"rows_produced_per_join": 762,
"filtered": "33.92",
"cost_info": {
"read_cost": "561.89",
"eval_cost": "76.25",
"prefix_cost": "1595.88",
"data_read_per_join": "11K"
},
"used_columns": [
"product_id",
"category_id"
],
"attached_condition": "(`dbggbern`.`products_categories`.`category_id` in (7,16,8,9,10,22,23,24,25,27,28,39,45,67,169,167,168,182,176,177,178,179,180,183,184,185,186,187,295,349,431,500,512,551,634))"
}
},
{
"table": {
"table_name": "cscart_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"dbggbern.products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 762,
"filtered": "100.00",
"cost_info": {
"read_cost": "190.62",
"eval_cost": "76.25",
"prefix_cost": "1862.74",
"data_read_per_join": "2M"
},
"used_columns": [
"category_id",
"usergroup_ids"
],
"attached_condition": "((`dbggbern`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`dbggbern`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`dbggbern`.`cscart_categories`.`usergroup_ids`)))"
}
}
]
}
}
}
}
Result
| product_id |
product_type |
parent_product_id |
| 4004 |
P |
0 |
| 4005 |
P |
0 |
| 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 |
| 493 |
P |
0 |
| 494 |
P |
0 |
| 488 |
P |
0 |
| 492 |
P |
0 |
| 416 |
P |
0 |
| 497 |
P |
0 |
| 495 |
P |
0 |
| 3182 |
P |
0 |
| 3181 |
P |
0 |