Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not optimized
Message
 
 
À
15/02/2010 14:06:11
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:
01449212
Vues:
85
>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%'
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform