Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not optimized
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01449210
Message ID:
01449229
Vues:
54
>>The following is very slow, presumably because of my use of IN
Select * From KTrackTagDetail							;
>>	where (Seqno In (Select Seqno From C_Kits)			;
>>	or SeqnoFG In (Select Seqno From C_Kits))			;
>>	and Left (RecordType,2) # 'AP'						;
>>	into Cursor C_Detail
>>So, how can I speed this up?
>>
>>Thanks
>
>Jim,
>
>Alternative solution would be to use EXISTS. Also, do you have an index on LEFT(RecordType,2) -- if not, use NOT LIKE instead.
>
>select ...
>from myTable T where exists (select 1 from c_Kits K where K.SeqNo = T.SeqNo) and NOT RecordType LIKE 'AP%'
>UNION
>select ...from myTable T where exists (select 1 from c_Kits K where K.SeqNo = T.SeqNoFG) and NOT RecordType LIKE 'AP%'
One more thing - assuming you have an index on both SeqNo and SeqNoFG and LEFT(RecordType,2) then add NOFILTER to your select statement.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform