Query time 0.46583
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "1367.97"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": false,
"nested_loop": [
{
"table": {
"table_name": "inventory",
"access_type": "system",
"possible_keys": [
"pc"
],
"rows_examined_per_scan": 0,
"rows_produced_per_join": 1,
"filtered": "0.00",
"const_row_not_found": true,
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.10",
"prefix_cost": "0.00",
"data_read_per_join": "880"
},
"used_columns": [
"product_id",
"amount"
]
}
},
{
"table": {
"table_name": "products",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"status"
],
"key": "status",
"used_key_parts": [
"status"
],
"key_length": "3",
"ref": [
"const"
],
"rows_examined_per_scan": 1420,
"rows_produced_per_join": 1420,
"filtered": "100.00",
"cost_info": {
"read_cost": "356.43",
"eval_cost": "142.00",
"prefix_cost": "498.43",
"data_read_per_join": "6M"
},
"used_columns": [
"product_id",
"status",
"amount",
"usergroup_ids",
"tracking",
"stoc_intern",
"pret_achizitie",
"pret_revanzator",
"gestiune"
],
"attached_condition": "((0 <> (case `maniamall_cscart`.`products`.`tracking` when 'O' then <cache>((NULL > 0)) when 'B' then (`maniamall_cscart`.`products`.`amount` > 0) else 1 end)) and ((`maniamall_cscart`.`products`.`usergroup_ids` = '') or (0 <> find_in_set(0,`maniamall_cscart`.`products`.`usergroup_ids`)) or (0 <> find_in_set(1,`maniamall_cscart`.`products`.`usergroup_ids`))))"
}
},
{
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "lower_limit",
"used_key_parts": [
"lower_limit",
"product_id"
],
"key_length": "6",
"ref": [
"const",
"maniamall_cscart.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 710,
"filtered": "50.00",
"using_index": true,
"cost_info": {
"read_cost": "451.82",
"eval_cost": "71.00",
"prefix_cost": "1092.25",
"data_read_per_join": "16K"
},
"used_columns": [
"product_id",
"lower_limit",
"usergroup_id"
],
"attached_condition": "(`maniamall_cscart`.`prices`.`usergroup_id` in (0,0,1))"
}
},
{
"table": {
"table_name": "cscart_product_sales",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"pa"
],
"key": "pa",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"maniamall_cscart.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 236,
"filtered": "33.33",
"index_condition": "(`maniamall_cscart`.`cscart_product_sales`.`amount` >= 1)",
"cost_info": {
"read_cost": "177.50",
"eval_cost": "23.66",
"prefix_cost": "1340.75",
"data_read_per_join": "3K"
},
"used_columns": [
"category_id",
"product_id",
"amount"
]
}
},
{
"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": [
"maniamall_cscart.cscart_product_sales.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 11,
"filtered": "5.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "1.18",
"prefix_cost": "1364.42",
"data_read_per_join": "30K"
},
"used_columns": [
"category_id",
"company_id",
"usergroup_ids",
"status"
],
"attached_condition": "((`maniamall_cscart`.`cscart_categories`.`company_id` = 1) and ((`maniamall_cscart`.`cscart_categories`.`usergroup_ids` = '') or (0 <> find_in_set(0,`maniamall_cscart`.`cscart_categories`.`usergroup_ids`)) or (0 <> find_in_set(1,`maniamall_cscart`.`cscart_categories`.`usergroup_ids`))) and (`maniamall_cscart`.`cscart_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"ref": [
"maniamall_cscart.cscart_product_sales.category_id",
"maniamall_cscart.products.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 11,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "0.00",
"eval_cost": "1.18",
"prefix_cost": "1365.60",
"data_read_per_join": "189"
},
"used_columns": [
"product_id",
"category_id"
]
}
},
{
"table": {
"table_name": "shared_descr",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"product_id",
"company_id"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id",
"lang_code",
"company_id"
],
"key_length": "13",
"ref": [
"maniamall_cscart.products.product_id",
"const",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 11,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "1.18",
"prefix_cost": "1366.79",
"data_read_per_join": "45K"
},
"used_columns": [
"product_id",
"lang_code",
"company_id",
"product"
]
}
},
{
"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": [
"maniamall_cscart.products.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 11,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "1.18",
"prefix_cost": "1367.97",
"data_read_per_join": "45K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
}
]
}
}
}
}
Result
| product_id |
product |
sales_amount |
stoc_intern |
pret_achizitie |
pret_revanzator |
gestiune |
| 1437277 |
Covoras rotund imitatie blana, pentru bradul de Craciun, diametru 122 cm, blanita culoare alb |
12320 |
-99 |
0.00 |
86.00 |
Y |
| 1139909 |
Set role universale inferioare si superioare pentru cabina de dus, cu rulmenti, 24 piese |
1212 |
-99 |
21.14 |
25.37 |
Y |
| 1128285 |
Set perne decorative pentru mobilier paleti, perna sezut 120x70 cm + perna spate 120x40 cm, culoare gri |
952 |
0 |
0.00 |
19.00 |
Y |
| 897024 |
Costum de Mos Craciun pentru adulti, 5 piese,material flausat |
722 |
-99 |
42.92 |
45.99 |
Y |
| 1108774 |
Folie Carbon 3D Negru, 1x1.27m |
691 |
-99 |
0.00 |
31.00 |
Y |