Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL speed difference
Message
 
À
20/08/1997 22:44:50
Siu-Hung Lai
The Hong Kong University of Sci. & Tech.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00044159
Message ID:
00046286
Vues:
25
>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 )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform