Greg Stark <gsstark(at)mit(dot)edu> writes:
> I think this is just a bad case of "nested loops are costed wrong".
Looks to me like a statistical failure. Why does it think there will be
4000 rows out of that join when there are only 93?
regards, tom lane