Board index » delphi » Sub Query is Sooooooo Sloooooow (D2/W95/Paradox7)
David Carle
![]() Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Sub Query is Sooooooo Sloooooow (D2/W95/Paradox7)
I am creating a query to select the companies (customers) for which a certain user is any type of internal
contact (eg Sales, Support, Accounts etc) The Company table has a primary key of CoID and the structure of the IntCont (Internal Contacts) table is: ICID Autonumber Primary Key ICFilePrefix Alpha 2 ("CO" when linked to company table) ICRecordFK Integer Foreign Key to CoID ICType Integer Contact Type lookup ICUserFK Integer Foreign Key to user table This table has a secondary key on ICFilePrefix + ICRecordFK and also a secondary key on ICFilePrefix + ICUserFK Both tables are Paradox 7 on a local PC and contain approx 4000 records (currently 1 to 1, but other internal it works but takes 2mins30sec to 3mins30secs to run! If I use a join such as: What I'd like to know is why the sub-query takes so long (I guess it must be checking each of the 4000 BTW I'd like to use the sub-query because the query can already be pretty complex (eg selecting from the TIA for any suggestions. |