Write the results to a table for multistage query it is costing to much data.

In many operations such as row_number it will cost a lot more data than the selected columns. Writing to a destination table would save some data.