Query time 0.01087
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "129.36"
},
"ordering_operation": {
"using_filesort": true,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"buffer_result": {
"using_temporary_table": true,
"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.20",
"prefix_cost": "0.00",
"data_read_per_join": "976"
},
"used_columns": [
"product_id",
"amount"
]
}
},
{
"table": {
"table_name": "products_categories",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"pt"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id",
"product_id"
],
"key_length": "6",
"rows_examined_per_scan": 176,
"rows_produced_per_join": 176,
"filtered": "100.00",
"using_index": true,
"cost_info": {
"read_cost": "40.59",
"eval_cost": "35.20",
"prefix_cost": "75.78",
"data_read_per_join": "2K"
},
"used_columns": [
"product_id",
"category_id"
],
"attached_condition": "((`portal`.`products_categories`.`category_id` in (412,437,413,414,415,416,417,565)) and (`portal`.`products_categories`.`product_id` <> 30660))"
}
},
{
"table": {
"table_name": "q_categories",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"c_status",
"p_category_id"
],
"key": "PRIMARY",
"used_key_parts": [
"category_id"
],
"key_length": "3",
"ref": [
"portal.products_categories.category_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 35,
"filtered": "20.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "7.04",
"prefix_cost": "110.98",
"data_read_per_join": "92K"
},
"used_columns": [
"category_id",
"usergroup_ids",
"status"
],
"attached_condition": "(((`portal`.`q_categories`.`usergroup_ids` = '') or find_in_set(0,`portal`.`q_categories`.`usergroup_ids`) or find_in_set(1,`portal`.`q_categories`.`usergroup_ids`)) and (`portal`.`q_categories`.`status` in ('A','H')))"
}
},
{
"table": {
"table_name": "products",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY",
"status"
],
"key": "PRIMARY",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"portal.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 32,
"filtered": "93.11",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "6.55",
"prefix_cost": "118.03",
"data_read_per_join": "193K"
},
"used_columns": [
"product_id",
"product_type",
"status",
"company_id",
"amount",
"timestamp",
"usergroup_ids",
"tracking",
"parent_product_id"
],
"attached_condition": "((case `portal`.`products`.`tracking` when 'O' then <cache>((NULL > 0)) when 'B' then (`portal`.`products`.`amount` > 0) else 1 end) and ((`portal`.`products`.`usergroup_ids` = '') or find_in_set(0,`portal`.`products`.`usergroup_ids`) or find_in_set(1,`portal`.`products`.`usergroup_ids`)) and (`portal`.`products`.`status` = 'A'))"
}
},
{
"table": {
"table_name": "companies",
"access_type": "eq_ref",
"possible_keys": [
"PRIMARY"
],
"key": "PRIMARY",
"used_key_parts": [
"company_id"
],
"key_length": "4",
"ref": [
"portal.products.company_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "10.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.66",
"prefix_cost": "124.58",
"data_read_per_join": "18K"
},
"used_columns": [
"company_id",
"status",
"company"
],
"attached_condition": "(`portal`.`companies`.`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": [
"portal.products_categories.product_id",
"const"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 3,
"filtered": "100.00",
"cost_info": {
"read_cost": "0.00",
"eval_cost": "0.66",
"prefix_cost": "125.24",
"data_read_per_join": "12K"
},
"used_columns": [
"product_id",
"lang_code",
"product"
]
}
},
{
"table": {
"table_name": "prices",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"portal.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "5.00",
"index_condition": "((`portal`.`prices`.`lower_limit` = 1) and (`portal`.`prices`.`usergroup_id` in (0,0,1)))",
"cost_info": {
"read_cost": "3.28",
"eval_cost": "0.03",
"prefix_cost": "129.17",
"data_read_per_join": "3"
},
"used_columns": [
"product_id",
"price",
"percentage_discount",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`portal`.`prices`.`price` >= 66.00) and (`portal`.`prices`.`price` <= 154.00))"
}
},
{
"table": {
"table_name": "prices_2",
"access_type": "ref",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "usergroup",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"ref": [
"portal.products_categories.product_id"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 0,
"filtered": "10.00",
"not_exists": true,
"cost_info": {
"read_cost": "0.16",
"eval_cost": "0.00",
"prefix_cost": "129.36",
"data_read_per_join": "0"
},
"used_columns": [
"product_id",
"price",
"lower_limit",
"usergroup_id"
],
"attached_condition": "(<if>(found_match(prices_2), isnull(`portal`.`prices_2`.`price`), true) and <if>(is_not_null_compl(prices_2), ((`portal`.`prices_2`.`lower_limit` = 1) and (`portal`.`prices_2`.`price` < `portal`.`prices`.`price`) and (`portal`.`prices_2`.`usergroup_id` in (0,0,1))), true))"
}
}
]
}
}
}
}
}
Result
product_id |
product |
company_name |
price |
product_ids |
product_types |
parent_product_ids |
product_type |
parent_product_id |
51141 |
3PCS Bundle inpod Pro + Powerbank + Rechargeable Dancing Toys |
Vilocity cart |
69.000000 |
51141 |
P |
0 |
P |
0 |
50647 |
WiFi Smart Net Camera, Lens 3.6MM ,View Your World From Anywhere/Anytime, Support For Computer, iOS & Android |
Vilocity cart |
70.000000 |
50647 |
P |
0 |
P |
0 |
34284 |
TXD-G1 RC Wi-Fi 360° Foldable High Speed Drone |
Smartmart123 |
140.000000 |
34284 |
P |
0 |
P |
0 |
34374 |
360 Degree Panoramic Camera Wifi Indoor IP Camera Fisheye Baby Monitor |
Smartmart123 |
126.000000 |
34374 |
P |
0 |
P |
0 |
29196 |
Fujifilm Instax Mini Instant Film Twin Pack (white) |
J D F General Trading LLC |
68.000000 |
29196 |
P |
0 |
P |
0 |
29360 |
Black 20M Waterproof Underwater Camera Diving Bag Case Pouch For Nikon Canon Digital Slr Camera |
J D F General Trading LLC |
129.000000 |
29360 |
P |
0 |
P |
0 |