Alex Howansky <alex@wankwood.com> writes:
> [ lots of bad stuff ]
Hm. As Richard remarks, 6M records is not an especially big table;
there are people running larger ones. The leftover sorttemp files sound
like you are suffering backend crashes --- but you didn't mention
anything about unexpected disconnects.
The postmaster log would be a good place to look for more info (if
you're not keeping one, turn it on). Also, make sure the postmaster
is not being run with an environment of "ulimit -c 0" ... if the
backends are crashing, we want to get some core files so we can see
what's happening.
regards, tom lane