Real Row Counts for Big Orders
EasyDescription
This query lists the orders whose total is above the average order total:
CodeSELECT customer_id, total_amount FROM orders WHERE total_amount > (SELECT AVG(total_amount) FROM orders);
Show its plan with the real number of rows each step produced. Leave out the estimated costs, the timings and the summary of planning and execution time, so that the plan is exactly the same on every run.
Tables
| orders |
|---|
| order_id (PK) |
| customer_id (FK) |
| order_date |
| status |
| total_amount |
| shipping_city |