Hi, I asked about this before and am still fighting for success; any ideas I tried adding a index on jobtitle.
Explain analyze returns
QUERY PLAN "Merge Join (cost=53053.05..53652.66 rows=4888 width=113) (actual time=9788.066..11042.584 rows=85694 loops=1)" " Merge Cond: (""outer"".locationid = ""inner"".locationid)" " -> Sort (cost=604.65..605.45 rows=319 width=49) (actual time=5.367..6.729 rows=402 loops=1)" " Sort Key: l.locationid" " -> Index Scan using ix_location on tbllocation l (cost=0.00..591.38 rows=319 width=49) (actual time=0.193..3.548 rows=402 loops=1)" " Index Cond: ('SAKS'::text = (clientnum)::text)" " -> Sort (cost=52448.40..52710.82 rows=104970 width=75) (actual time=9782.634..10100.572 rows=85695 loops=1)" " Sort Key: a.locationid" " -> Merge Right Join (cost=39859.63..41130.10 rows=104970 width=75) (actual time=6811.114..8284.253 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..226.47 rows=6343 width=37) (actual time=0.089..33.082 rows=5662 loops=1)" " Filter: (1 = presentationid)" " -> Sort (cost=39859.63..40122.06 rows=104970 width=53) (actual time=6763.992..7160.587 rows=99139 loops=1)" " Sort Key: (a.clientnum)::text, a.jobtitleid" " -> Seq Scan on tblassociate a (cost=0.00..31105.34 rows=104970 width=53) (actual time=0.478..1831.000 rows=99139 loops=1)" " Filter: ((clientnum)::text = 'SAKS'::text)" "Total runtime: 11319.403 ms"
Joel Fradkin
Wazagua, Inc.
[EMAIL PROTECTED]
|