Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tuning SQL statement
Message
 
 
À
09/09/2004 12:39:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00940327
Message ID:
00940713
Vues:
18
Try
...
   INNER JOIN smagic!termcourse ;
   ON  Attendance.crsschedid = Termcourse.crsschedid ;
      AND Termcourse.crsschedid = ( ?vp_crsschedid );
...
>>Make sure you've indexes on all fields used in JOINs. Quick loock revealed that you don't have indexes in the Termcourse table for following joins
...
>>   ON  Termcourse.roomid = Roomslist.roomid ;
>>    INNER JOIN smagic!schedulehours ;
>>   ON  Termcourse.hourid = Schedulehours.hourid ;
>>    INNER JOIN smagic!teacherlist ;
>>   ON  Termcourse.teacherid = Teacherlist.teacherid;
>>...
>>
>
>I added those, but it's still not so good. I think what's causing it is
>
>>>Joining table schedulehours and table termcourse (Cartesian product)
>>>Joining intermediate result and table roomslist (Cartesian product)
>>>Joining intermediate result and table programlist (Cartesian product)
>>>Joining intermediate result and table teacherlist (Cartesian product)
>>>Joining intermediate result and table courses (Cartesian product)
>>>Joining intermediate result and table courselist (Cartesian product)
>>>Joining intermediate result and table enroll (Cartesian product)
>>>Joining intermediate result and table attendance (Cartesian product)
>>>Joining intermediate result and table person (Cartesian product)
>
>these Cartesian joins. The WHERE Termcourse.crsschedid = (?vp_crsschedid) will filter it down to the 29 record result, so how do I make it evaluate the where clause early?
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform