Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inner Joins and performance.
Message
De
21/08/2007 05:08:32
 
 
À
21/08/2007 04:50:32
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 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01249286
Message ID:
01249287
Vues:
20
Hi Kev

Can't be sure but I'd imagine no 1 would be quicker, in that I envision the mechanism of 2-table queries like this as just iterating through the 1st table and searching for matches in the 2nd, for each rec visited. So, the "many" searches are on a shorter table.

Sped up by having them both ordered on the search field of course.

Why not run both with:

ldTime1 = TIME()
Select ...
ldTime2 = TIME()
lnNoSecs = ldTime2 - ldTime1

and suck it and see?

Terry

>Hi all
>
>I have a particular scenario and I wanted to know if the table I specify in the FROM will have any affect on performance, take this example:
>
>Table1 - 200,000 records
>Table2 - 17,000 records
>
>Table1 can have 0 or 1 records in Table2.
>
>Will this:
>
>
select *
>from Table1
>inner join Table2
>on Table1.PK = Table2.FK
>
>
>perform worse than this:
>
>
select *
>from Table2
>inner join Table1
>on Table2.FK = Table1.PK
>
>
>Just curious, given that Table1 has more records than Table2 - will the above queries result in different performance?
>
>Thanks
>Kev
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform