El-Lotso <el.lotso@xxxxxxxxx> writes: > I'm really at my wits end here. Try to merge the multiple join keys into one, somehow. I'm not sure why the planner is overestimating the selectivity of the combined join conditions, but that's basically where your problem is coming from. A truly brute-force solution would be "set enable_nestloop = off" but this is likely to screw performance for other queries. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org