Query time 0.09814
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1333.61"
},
"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",
"amount",
"usergroup_ids",
"parent_product_id",
"pos_availabilty",
"datahub_amount"
],
"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": "popularity",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"total"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"dbggbern.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 249,
"filtered": "33.33",
"cost_info": {
"read_cost": "187.30",
"eval_cost": "24.97",
"prefix_cost": "809.24",
"data_read_per_join": "7K"
},
"used_columns": [
"product_id",
"total"
],
"attached_condition": "(`dbggbern`.`popularity`.`total` >= 1)"
}
},
{
"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": 749,
"filtered": "100.00",
"cost_info": {
"read_cost": "187.28",
"eval_cost": "74.91",
"prefix_cost": "1071.43",
"data_read_per_join": "11K"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"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": 749,
"filtered": "100.00",
"cost_info": {
"read_cost": "187.28",
"eval_cost": "74.91",
"prefix_cost": "1333.61",
"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 |
popularity |
dh_stock_only |
product_type |
parent_product_id |
| 5204 |
93370 |
0 |
P |
0 |
| 5205 |
92713 |
0 |
P |
0 |
| 5203 |
90615 |
0 |
P |
0 |
| 5201 |
78902 |
0 |
P |
0 |
| 5859 |
78515 |
0 |
P |
0 |
| 5199 |
77698 |
0 |
P |
0 |
| 3894 |
76790 |
0 |
P |
0 |
| 5173 |
70872 |
0 |
P |
0 |
| 5175 |
68182 |
0 |
P |
0 |
| 5174 |
66781 |
0 |
P |
0 |