{
"query_block": {
"select_id": 1,
"cost": 0.28259592,
"nested_loop": [
{
"table": {
"table_name": "p",
"access_type": "range",
"possible_keys": ["PRIMARY", "status"],
"key": "PRIMARY",
"key_length": "3",
"used_key_parts": ["product_id"],
"loops": 1,
"rows": 80,
"cost": 0.13989432,
"filtered": 100,
"attached_condition": "p.product_id in (461025,461181,111833,312414,461219,390978,11893,312412,312456,461036,153,312443,230,312444,391037,312436,461212,312847,312450,168,312451,391029,390993,164,312418,391030,12708,227,221,233,116547,461189,461276,312458,119,312455,170,21914,165,312424,391040,312724,312419,22384,391025,312446,393787,461033,312870,116427,202,11677,183,400913,312863,312411,312864,312421,312051,461190,312449,111,166,312723,116539,461035,400924,9,461034,461027,312856,116529,312849,280,312043,312416,400914,312466,187,116425) and p.`status` = 'A' and p.list_price > 0"
}
},
{
"table": {
"table_name": "pp",
"access_type": "ref",
"possible_keys": ["usergroup", "product_id", "lower_limit"],
"key": "usergroup",
"key_length": "3",
"used_key_parts": ["product_id"],
"ref": ["u985510652_ecartify.p.product_id"],
"loops": 80,
"rows": 1,
"cost": 0.1427016,
"filtered": 100,
"attached_condition": "pp.lower_limit = 1 and p.list_price > pp.price and round((p.list_price - pp.price) / p.list_price * 100,0) >= 5"
}
}
]
}
}
| product_id | list_price | price | discount_pct |
|---|---|---|---|
| 280 | 150.00 | 50.00 | 67 |
| 12708 | 1499.00 | 999.00 | 33 |
| 22384 | 500.00 | 250.00 | 50 |
| 111833 | 605.00 | 100.00 | 83 |
| 116529 | 399.00 | 199.00 | 50 |
| 116547 | 417.00 | 217.00 | 48 |
| 312043 | 60.00 | 45.50 | 24 |
| 312051 | 200.00 | 150.00 | 25 |
| 461033 | 3000.00 | 1000.00 | 67 |
| 461035 | 2100.00 | 1000.00 | 52 |
| 461036 | 2100.00 | 1000.00 | 52 |