Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL speed difference
Message
 
To
20/08/1997 22:44:50
Siu-Hung Lai
The Hong Kong University of Sci. & Tech.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00044159
Message ID:
00046286
Views:
30
>Thanks for the replies from all of you.
>
> I got around 10% faster by setting DELETED off. By using SYS(3054), I
>found that the first SQL-SELECT (takes 35 sec) in the prg is not fully
>optimized. I try different ways to SELECT but not success.
>
>Table : SaleList (180,000 records)
>Fields: iSaleId, dSaleDate,....
>Index : iSaleId, dSaleDate
>
>Table : SaleProd (340,000 records)
>Fields: iSaleId, iPdid, iSaleQty,....
>Index : iSaleId, iPdid
>
>SELECT SaleProd.iPdid, SUM(SaleProd.iSaleQty) AS TotalSale ;
>FROM SaleProd, SaleList ;
>WHERE SaleProd.iSaleId = SaleList.iSaleId .AND. ;
> SaleList.dSaleDate >= CTOD("14/07/96") ;
>GROUP BY SaleProd.iPdid
>

two possibilities for improvement :

1. replace >= CTOD("14/07/96") with >= {14/07/96}

2. or leave the WHERE condition as is and have an index on CTOD(dSaleDate) instead of dSaleDate


hoping this helps
Christian Desbourse ( Belgium )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform