"Clay Luther" <claycle(at)cisco(dot)com> writes:
> Sort_mem is 32K.
Try more (like 32M). Particularly in 7.4, you can really hobble a query
by starving it for sort memory (since that also determines whether
hashtable techniques will be tried).
regards, tom lane