Adam Endicott <leftwing17@gmail.com> writes:
> Here's the output from explain analyze.
Wow, so the differential is all in the sort step.
8.2 does have improved sorting code, but I don't think that explains
the difference, especially not for a mere 16000 rows to be sorted.
Do you have comparable work_mem settings on both machines? Another
thing to look at, if any of the sort key columns are textual, is whether
the lc_collate settings are the same.
regards, tom lane