Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating records in FoxPro tables
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00565010
Message ID:
00569748
Views:
25
>< SNIP >
>
>>For 50000 records the results are:
>>Method 1: 0.423
>>Method 2: 1.556
>>Method 3: 0.904
>>Method 4: 0.531
>>
>>For 100000 records the results are:
>>Method 1: 0.800
>>Method 2: 3.707
>>Method 3: 1.803
>>Method 4: 2.277
>>
>>For 200000 records the results are:
>>Method 1: 2.094
>>Method 2: 100.774 && Very strange
>>Method 3: 6.592
>>Method 4: 4.155
>
>SET TALK OFF set safety off
>*For 50000 records the results are:
>*Method 1: 0.271
>*Method 2: 0.491
>*Method 3: 0.471
>*Method 4: 0.321
>
>*For 100000 records the results are:
>*Method 1: 0.511
>*Method 2: 1.302
>*Method 3: 0.961
>*Method 4: 0.571
>
>*For 200000 records the results are:
>*Method 1: 0.942
>*Method 2: 5.738
>*Method 3: 1.932
>*Method 4: 1.111
>
>*For less than 10,000 the result is:
>*Method 1: 0.000 *
>*Method 2: 0.130
>*Method 3: 0.080
>*Method 4: 0.090
>
>And the winner is : Meth1 - Dele All, Ind Unique, Recall All
>Runner up : Meth4 - Sele into Cur, Append
>
>Why is method4 slower than Scan in Scan or Do While?

Actually, your tests confirmed mine and showed, that method 4 is a little bit faster, than method 3. I already excluded method 2 (scanning the whole table) from consideration, because it's the slowest method. So, if you need to choose between 1 and either 3 or 4, I would choose method 1, if:
1) You don't have deleted records in a table (e.g. just did pack)
2) It doesn't matter, which "unique" record should be left in a table.

As I noted in the bottom of my FAQ methods 3 & 4 could be modified to add some logic, which record we want to be remained in a table. I didn't add a code in a FAQ in order to not complicate it.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform