QUERY PLAN "Merge Join (cost=47489.81..47975.65 rows=3758 width=111) (actual time=27167.305..29701.080 rows=85694 loops=1)" " Merge Cond: (""outer"".locationid = ""inner"".locationid)" " -> Sort (cost=1168.37..1169.15 rows=312 width=48) (actual time=261.096..262.410 rows=402 loops=1)" " Sort Key: l.locationid" " -> Index Scan using ix_tbllocation on tbllocation l (cost=0.00..1155.44 rows=312 width=48) (actual time=213.107..259.160 rows=402 loops=1)" " Index Cond: ('SAKS'::text = (clientnum)::text)" " -> Sort (cost=46321.45..46535.47 rows=85611 width=74) (actual time=26906.148..27689.258 rows=85695 loops=1)" " Sort Key: a.locationid" " -> Merge Right Join (cost=38119.24..39307.55 rows=85611 width=74) (actual time=22236.915..25384.945 rows=99139 loops=1)" " Merge Cond: (((""outer"".clientnum)::text = ""inner"".""?column10?"") AND (""outer"".id = ""inner"".jobtitleid))" " -> Index Scan using ix_tbljobtitle_id on tbljobtitle jt (cost=0.00..338.90 rows=6337 width=37) (actual time=164.976..2290.760 rows=5662 loops=1)" " Filter: (1 = presentationid)" " -> Sort (cost=38119.24..38333.26 rows=85611 width=52) (actual time=20667.645..21031.627 rows=99139 loops=1)" " Sort Key: (a.clientnum)::text, a.jobtitleid" " -> Seq Scan on tblassociate a (cost=0.00..31105.34 rows=85611 width=52) (actual time=14.768..16024.395 rows=99139 loops=1)" " Filter: ((clientnum)::text = 'SAKS'::text)" "Total runtime: 30319.859 ms"