Ed Loehr <eloehr(at)austin(dot)rr(dot)com> writes:
> But I'm still wondering why it is still doing a seq scan on the
> "ahrn.activity_id = a.id" part when both of those integer columns are
> indexed??
Presumably because it thinks the hash join is cheaper than a nestloop
or merge join would be ... although that seems kinda surprising. What
plans do you get if you try various combinations of
set enable_hashjoin = off;
set enable_mergejoin = off;
set enable_nestloop = off;
How do the cost estimates compare against the actual runtimes for
doing the query each way?
regards, tom lane