Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can this SQL run faster
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
Database:
Visual FoxPro
Divers
Thread ID:
01004644
Message ID:
01004723
Vues:
14
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform