Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can this SQL run faster
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01004644
Message ID:
01004723
Views:
20
Another thing to consider for improving speed overall is to not do a Select *, but just get the fields you want.

-w-

>I have a SQL statement I want to use:
>
>SELECT * FROM CONTDB WHERE IDNUM IN (SELECT IDNUM FROM AGENT_NUMS WHERE AGENT_NUM="33C212")
>
>It runs in 30 to 40 seconds.
>
>The following statements give me the same data is less than 1 second. Is there anything I can do to make the first statement run as quickly? IDNUM is an Integer, indexed in both tables, primary key for contdb.
>
>
>SELECT contdb.* FROM CONTDB RIGHT JOIN AGENT_NUMS ON Contdb.IDNUM = agent_nums.idnum WHERE agent_nums.agent_NUM="33C212"
>
>SELECT * FROM CONTDB WHERE IDNUM = (SELECT IDNUM FROM AGENT_NUMS WHERE AGENT_NUM="33C212")
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Reply
Map
View

Click here to load this message in the networking platform