"Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com> writes:
> Merge Join (cost=1081799.72..1088792.93 rows=1518781 width=237)
> -> Index Scan using t_mbr_ben_spans_i on t_mbr_ben_spans b
> (cost=0.00..3053.66 rows=51333 width=30)
> -> Sort (cost=1081799.72..1081799.72 rows=1518781 width=207)
> -> Seq Scan on mbr a (cost=0.00..73602.81 rows=1518781 width=207)
Increasing sort_mem would make that cost estimate drop. What effects
it'd have on the actual runtime is harder to say; but I never trust
EXPLAIN's estimates very much ;-)
regards, tom lane