Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
While vrs. SQL (while is so speed)
Message
 
To
30/04/1998 21:08:21
Fernando España
Alta Tecnologia En Informatica
Guatemala, Guatemala
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00096194
Message ID:
00096207
Views:
16
Fernando,

The fact is that SEEK and WHILE is often faster when you're using a single index. One thing you may need to do is add an index on DELETED(). If DELETED is set ON and you don't have a tag using DELETED() as its expression, add one.


>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!!!
Previous
Reply
Map
View

Click here to load this message in the networking platform