Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
While vrs. SQL (while is so speed)
Message
De
30/04/1998 21:08:21
Fernando España
Alta Tecnologia En Informatica
Guatemala, Guatemala
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
While vrs. SQL (while is so speed)
Divers
Thread ID:
00096194
Message ID:
00096194
Vues:
54
I have a table with 15250326 records and I have problem with speed, I make a question and every body say USE A SQL-Select
this is very fast, but i try to do this and the sql-Select is very slow, but using a while is more fast
**when skip
Select sum(amount) as amount from Detail where ID_Customer=;
thisform.customerid.value into array Total_cust
thisform.customertotal.value=total_cust
thisform.refresh

this take a seven seconds in a Pentium 166 mmx with 32 Mb. ram
runing on a NT 4.0 lan with 100 workstations working in the same program.

the time ig good but if I need skip record by record the elapsed time is very slow, the I do the next:

**when Skip
Select Detail
**the detail table is order by ID_Customer
if seek(thisform.customerid.value)
Sum(amount) to thisform.customertotal.value while idcustomer=;
thisform.customerid.value
thisform.refresh
Select Customers
Endif

this proces take two seconds and is very fast!!!

Can somebody tellme why while is more quick than a SQL ?

thanks

Sory for my English!!!
Fernando España
SQL Server Specialist
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform