Thanks,
I don't have a strong opinion on how this is fixed, but I personally think that
is a bug that needs addressing in back branches.
I think I remember hitting OOMs in similar situations with hashjoins in the past
and I just disabled them.
But I'd certainly argue the situation here is more severe with 12 million temp files (possibly more).
Even the cancelling of the query doesn't quite work well,
because the deletion of temp files is not fast enough in the cancellation.
Only the restarting of the server does delete tmp files fast enough (takes a few min still).
And apparently even ls can't quite deal with 12 millions files in a folder.
Sergey
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e
buidheanncarthannais a th’ ann an Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.