Hi all,

I am needing to speed up the following query (IB):

the innermost query run on its own takes way less than 1 second and returns
73 rows.

the middle query run on its own takes way less than 1 second and returns 3
rows of id's.

the outer query with no subqueries takes less than 1 second

put it all together and it takes 15 seconds to return 50 rows (from 2400
products)

select * from product p
  left join supplier s on p.supplierid=s.supplierid
  left join make m on p.makeid=m.makeid
  left join model md on p.modelid=md.modelid
  left join partgroup g on p.groupid=g.groupid
  left join parttype t on p.typeid=t.typeid
  left join supplierbranch b on p.branchid=b.branchid
where p.makeid=3 and p.groupid=14 and p.typeid=510
      and p.branchid in (
                          select branchid from branch
                          where regionname in (
                                               select supplierregion from
region
                                               where customerregion =
"Auckland City" and hours <= 48
                                              )
                        ) 


regards,

Steve
---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to