Abu Mushayeed <abumushayeed@xxxxxxxxx> writes: > I am trying to determine if I can make the planner see that nested loop is very expensive while it is trying to do an plan for a query and not pick that route. If it's doing that when it shouldn't, it's probably because it's underestimated the number of rows in the outer relation. Look to your stats settings. regards, tom lane