Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not optimized
Message
 
 
To
15/02/2010 14:06:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01449210
Message ID:
01449212
Views:
86
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform