Thank you very much.
I just tested pruning on the original case with the patchyou sent and confirm segfaults went away.
Regarding hash aggregation, I'll try to find a test case andfollow up within a day or so (cloning a huge db right now).