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:
00818705
Views:
22
Bernhart
First, Try to index on dates ( without DTOS ). First try it on DDATE, i think it will be enough. Then, do not use BETWEEN, but instead something like:
WHERE Table2.ddate>= dvStart and Table2.DDate <= dvend AND;
      Table2.ddate >= Table1.dStart and Table2.DDate <= Table2.dEnd
I think this will improve it dramatically. I had the same case a while ago.

HTH
Jaime


>Hi all,
>
>How can i improve a requery ?
>
>
>(Sample)
>LOCAL dvstart,;
>dvend
>
>
>dvstart = DATE() - 6000
>dvend = DATE() + 12000
>
>Table1
>NAME C(18)
>dstart D(8)
>dEnd D(8)
>
>
>Table2 && Many Records
>ddate D(8) && Unique dates
>Categorie C(1)
>
>
>A = SECONDS()
>
>
>Select COUNT(Temp2.Categorie ) FROM Table1,Table2 WHERE BETW(  Table2.ddate  , dvstart , dvend ) AND;
>BETW( Table2.ddate , Table1.dStart , Table2.dEnd )= .T;
>ORDER By Temp2.Categorie GROUP By Categorie Into Cursor Temp
>
>
>B=SECONDS()
> WAIT WINDOW NOWAIT TRANSFORM( B - A , "9999.99999")
>
>It 's slow !
>
>What can i do ?
>
>Index on DTOS(dstart) and DTOS(dend) and Dtos(ddate) don't improve.
>
>bernhart
Why do programs stop working correctly as soon as you leave the Fox?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform