If you store the result of the query in local file system, it is stored in the DSS server's file system (anywhere where it is configured in Connections). These files (this dataset) is deleted automatically if you delete the dataset and you check the checkbox to drop data. If you dont check the checkbox during the removal of the dataset, the files will remain on the server.
Regarding perf, you can create a ramdisk or attach a fast ssd to the dSS and store the dataset there. Or store it in /tmp.