On Fri, Jul 13, 2012 at 11:11 AM, Eoghan Murray <eoghan@xxxxxxxxxx> wrote: > 8.4: 314ms: http://explain.depesz.com/s/GkX > 9.1: 10,059ms :http://explain.depesz.com/s/txn > 9.1 with setting `enable_material = off`: 1,635ms > http://explain.depesz.com/s/gIu I think the problem is it's using a merge join, with a sort inside that's producing 600x more rows than expected, while 8.4 does a hash join with no intermediate big tables instead. What's your configuration like in both servers? (that could explain planning differences) -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance