Paul Malan wrote:
>> (Which join type is hidden behind the popup?)
>
> Sorry I left that covered up this time... Look here:
> http://www.redmondinc.com/sos/exe_plan.gif
> Is that sufficient?
Yes. It also reminds me why I dislike the graphical execution
plans from MS SQL Server :-)
>> Can you give me the recordcount of the following queries:
>> SELECT DISTINCT proj_code, cust_job_num, cust_code, order_code
>> FROM ordr;
>
> -- 712 rows
>
>> SELECT DISTINCT prod_descr, order_code
>> FROM ordl;
>
> -- 705 rows
It looks like eliminating some rows earlier may help here:
SELECT DISTINCT
t.tkt_code,
t.tkt_date,
t.truck_code,
t.po,
t.truck_net_wgt,
t.hler_code,
o.proj_code,
o.cust_job_num,
o.cust_code,
o.order_code,
k.curr_driv_empl_code,
l.prod_descr
FROM
tick t
INNER JOIN
(SELECT DISTINCT
proj_code,
cust_job_num,
cust_code,
order_code
FROM ordr
) o
ON t.order_code = o.order_code INNER JOIN
truc k
ON t.truck_code = k.truck_code INNER JOIN
(SELECT DISTINCT
order_code,
prod_descr
FROM ordl
) l
ON t.order_code = l.order_code
WHERE (t.tkt_date BETWEEN '#arguments.start_date#' AND
'#arguments.end_date#')
Jochem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189097
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54