## The Cost of Analytical Queries
Window functions (like `RANK()` or `SUM() OVER()`) are incredibly syntax-friendly compared to writing complex self-joins or correlated subqueries. However, developers often use them blindly against multi-million row tables.
Without a correct covering B-Tree index mirroring the `PARTITION BY` and `ORDER BY` clauses, the SQL execution engine will be forced to dump the entire table into a temporary file on disk to sort it (File Sort/Temp Spool), crashing your database IOPS instantly.