Fernando;
The SELECT command, as powerfull as it is, can be very picky. it does take advantage of rushmore technology, but only if you have the correct index tags created. From my readings, I understand that when a SELECT command is issued, VFP will determine what is the best way to look for the data: seek, set filter or .... This process can add a bit of overhead to the process. I used to go with the rule "stay away from SET FILTER", however I found that in certain cases the combination of SET FILTER TO xxxxx and LOCATE is far over 10 times faster than SELECT command. The bottom line is that you need to evaluate what command works best for your situation. Don't automatically assume that SELECT should be faster.
Hope this helps
Kia
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only