Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow SQL in .NET on Fox Tables
Message
From
23/05/2004 18:40:37
 
 
To
23/05/2004 16:40:08
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00906289
Message ID:
00906347
Views:
12
Hi, Tim-

>I'm pretty new to this and I really don't have an idea on how to optimize my Select statement to utilize the index on the table.

Okey dokey. Generally, you need to have an index on each expression you want to optimize on. So, in your example you want to have an index on job_num and product. I'm assuming you don't need to have UPPER() on the fields.

What I would suggest you do is create a program that does the select with everything the way it is right now. Don't make any changes to the data, so you have a baseline to compare. Then, add the indices and rerun the test and compare your results. Then, if the performance improved, try your .NET code again.

For an example, I wanted to adapt your VB.NET syntax to FoxPro. In doing so I suspect there's a typo in what you posted. If I made an error, let me know. Anyway, here goes:
LOCAL lni, lnj
SYS(3054,11) && You only have to turn this on once if you rerun the code.
lni = SECONDS()
SELECT job_num, product, slot FROM prodwip ;
  WHERE job_num = [somejobnum] .AND. (;
  product = '877' .OR. ;
  product = '863')
  product = 'NP2'
lnj = SECONDS()
?lnj - lni
The SYS() function tells you if and how well Rushmore is using indices. When you first run it, you shouldn't get any optimization. After you add your indices, you should see optimization.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform