Michael Enke <michael(dot)enke(at)wincor-nixdorf(dot)com> writes:
> For my setup, in 8.1 a delete query which deletes 200000 entries depending on rows in another table
> runs about 7h, in 8.2 (and later) it runs 9s!
If those rowcount estimates are even close to accurate, there's no
reason for the hash plan to be so much faster than the indexscan.
I think the real issue is somewhere else. Do you have any triggers
or foreign keys on this table?
regards, tom lane