Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Improve a requery
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00818689
Message ID:
00818720
Views:
20
Try to add indexes on the JOIN fields 'nposcat' and 'nType' in both tables. You can aslo play with JOIN itself
    FROM  DatesFiltred ;
    JOIN Etats ON DatesFiltred.nposcat = Etats.nposcat AND DatesFiltred.nType = Etats.nType AND ;
     DatesFiltred.ddate BETWEEN Etats.ddebut AND Etats.dfin  ;
* or 
    JOIN Etats ON DatesFiltred.nposcat = Etats.nposcat AND DatesFiltred.nType = Etats.nType ;
    WHERE DatesFiltred.ddate BETWEEN Etats.ddebut AND Etats.dfin  ;
>Sergey,
>
>I make 3 index but Vfp don't want optimze my requery.
>Why ?
>
>
> SYS(3054,11,"coptimation")
>
>
>  SELECT DatesFiltred.nposcat, ;
>    Etats.ccat_physiq  ,;
>    Etats.nType , ;
>    COUNT( DatesFiltred.ddate ) AS "Ncat" , ;
>    Etats.ltransfert  ;
>    FROM  DatesFiltred ,Etats;
>    WHER DatesFiltred.nposcat = Etats.nposcat AND DatesFiltred.nType = Etats.nType AND ;
>     DatesFiltred.ddate BETWEEN Etats.ddebut AND Etats.dfin  ;
>    ORDER BY  ltransfert , DatesFiltred.nType , DatesFiltred.nposcat ;
>    GROUP BY  ltransfert , DatesFiltred.nType , DatesFiltred.nposcat ;
>    INTO CURSOR Sum_Categ_per_periode && CURSOR tempstat2
>
>  SYS(3054,0)
>
>Rushmore optimization level for intermediate result: none
>Rushmore optimization level for table etats: none
>Joining table etats and intermediate result using temp index
>
>
>>
>>I don't see anything interesting in that mesage besides incorrect statement that BETWEEN isn't Rushmore optimizable. In fact it is.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform