Subject | 3 table join with SQL statements runs slow |
---|---|
Author | randmonroe |
Post date | 2002-06-11T18:50:20Z |
I'm currently running with InterBase 4.1, Delphi 5. The following
code returns a result instantly from the InterBase 4.1 system.
However, the same code running with FireBird database takes 11
seconds. I noticed once before when I tried moving to InterBase 6 I
experienced the same problem. Any ideas?
Select c.cert,c.status,a.administrator,c.process_date,
c.cancel_date,c.refund,c.check_date,c.check_num,c.cancel_fee,
c.cancel_method,c.cancel_reason,c.cancel_mileage,c.reserve,
c.insurance,c.admfee,c.aul,c.agent1_id,c.agent1_commission,
c.agent2_id,c.agent2_commission,c.agent3_id,c.agent3_commission,
c.total,c.net_refund,c.refund_pcnt,c.check_amt,a.finance_company,
a.customer_last,
a.dealer_id,a.plan_type,a.voucher_amt,d.dealer_name,d.address,
(d.city || ' ' || d.state || ' ' || d.zip) CityStateZip
from
Allcancel c, allsales a, dealers d
where
C.STATUS = 'Cancelled'
AND
A.ADMINISTRATOR = 'SZO'
AND
C.PROCESS_DATE > '05/17/02 00:00:00' and C.PROCESS_DATE < '05/17/02
23:59:59'
and a.cert=c.cert
and a.dealer_id=d.dealer_id
order by dealer_name,cert
code returns a result instantly from the InterBase 4.1 system.
However, the same code running with FireBird database takes 11
seconds. I noticed once before when I tried moving to InterBase 6 I
experienced the same problem. Any ideas?
Select c.cert,c.status,a.administrator,c.process_date,
c.cancel_date,c.refund,c.check_date,c.check_num,c.cancel_fee,
c.cancel_method,c.cancel_reason,c.cancel_mileage,c.reserve,
c.insurance,c.admfee,c.aul,c.agent1_id,c.agent1_commission,
c.agent2_id,c.agent2_commission,c.agent3_id,c.agent3_commission,
c.total,c.net_refund,c.refund_pcnt,c.check_amt,a.finance_company,
a.customer_last,
a.dealer_id,a.plan_type,a.voucher_amt,d.dealer_name,d.address,
(d.city || ' ' || d.state || ' ' || d.zip) CityStateZip
from
Allcancel c, allsales a, dealers d
where
C.STATUS = 'Cancelled'
AND
A.ADMINISTRATOR = 'SZO'
AND
C.PROCESS_DATE > '05/17/02 00:00:00' and C.PROCESS_DATE < '05/17/02
23:59:59'
and a.cert=c.cert
and a.dealer_id=d.dealer_id
order by dealer_name,cert