Each RANK will be a seperate step in explain and each step will spool all the rows twice.
What datatypes are the PARTITION/ORDER BY columns? VARCHARs are expanded to CHARs in that case, this might result in high spool usage.
Depending on the size of the "other columns" a solution might split the query in two Derived Tables, the data needed for RANKing and the "other columns" and then join them back.
Each RANK will be a seperate step in explain and each step will spool all the rows twice.
What datatypes are the PARTITION/ORDER BY columns? VARCHARs are expanded to CHARs in that case, this might result in high spool usage.
Depending on the size of the "other columns" a solution might split the query in two Derived Tables, the data needed for RANKing and the "other columns" and then join them back.
Dieter