Query time 0.01108
JSON explain
{
"query_block": {
"select_id": 1,
"cost_info": {
"query_cost": "94.86"
},
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"cost_info": {
"sort_cost": "8.38"
},
"nested_loop": [
{
"table": {
"table_name": "jmj_product_prices",
"access_type": "range",
"possible_keys": [
"usergroup",
"product_id",
"lower_limit",
"usergroup_id"
],
"key": "product_id",
"used_key_parts": [
"product_id"
],
"key_length": "3",
"rows_examined_per_scan": 42,
"rows_produced_per_join": 8,
"filtered": "19.94",
"index_condition": "(`jmj_test`.`jmj_product_prices`.`product_id` in (1717,1727,1704,1690,1685,1700,1709,1714,1711,1720,1703,1725,1629,1635,1614,1606,1602,1608,1631,1637,1634,1630,1611,1633))",
"cost_info": {
"read_cost": "81.13",
"eval_cost": "1.68",
"prefix_cost": "82.81",
"data_read_per_join": "201"
},
"used_columns": [
"product_id",
"price",
"percentage_discount",
"lower_limit",
"usergroup_id"
],
"attached_condition": "((`jmj_test`.`jmj_product_prices`.`lower_limit` = 1) and (`jmj_test`.`jmj_product_prices`.`usergroup_id` in (0,1)))"
}
},
{
"table": {
"table_name": "jmj_master_products_storefront_min_price",
"access_type": "ALL",
"possible_keys": [
"PRIMARY"
],
"rows_examined_per_scan": 1,
"rows_produced_per_join": 8,
"filtered": "100.00",
"using_join_buffer": "Block Nested Loop",
"cost_info": {
"read_cost": "2.00",
"eval_cost": "1.68",
"prefix_cost": "86.49",
"data_read_per_join": "134"
},
"used_columns": [
"storefront_id",
"product_id",
"price"
],
"attached_condition": "<if>(is_not_null_compl(jmj_master_products_storefront_min_price), ((`jmj_test`.`jmj_master_products_storefront_min_price`.`storefront_id` = 1) and (`jmj_test`.`jmj_master_products_storefront_min_price`.`product_id` = `jmj_test`.`jmj_product_prices`.`product_id`)), true)"
}
}
]
}
}
}
Result
| product_id |
price |
| 1602 |
589.00000000 |
| 1606 |
1249.00000000 |
| 1608 |
989.00000000 |
| 1611 |
289.00000000 |
| 1614 |
589.00000000 |
| 1629 |
599.00000000 |
| 1630 |
99.00000000 |
| 1631 |
1249.00000000 |
| 1633 |
949.00000000 |
| 1634 |
289.00000000 |
| 1635 |
399.00000000 |
| 1637 |
239.00000000 |
| 1685 |
399.00000000 |
| 1690 |
1149.00000000 |
| 1700 |
1449.00000000 |
| 1703 |
249.00000000 |
| 1704 |
1249.00000000 |
| 1709 |
1899.00000000 |
| 1711 |
949.00000000 |
| 1714 |
389.00000000 |
| 1717 |
349.00000000 |
| 1720 |
189.00000000 |
| 1725 |
1249.00000000 |
| 1727 |
549.00000000 |