Speeding up UpdateRecord

Fran=?ISO-8859-1?B?5w==?=ois Van Lerberghe frvanlerberghe at gmail.com
Sat Jan 11 11:27:37 CST 2014


To second that advaice, I would assign the field autside of the loop

MyFld = theCursor.Field("MessageBody")
Do
    myFld.value = theCleaner.execute
Loop until ...

Other ideas
- Are you flushing after each update or at the end
- Perhaps set index to false before the loop and reset to true after.

François Van Lerberghe
Rue Thier Monty, 15 A
4570 Marchin
+32 (0)85 25 08 25


le 11/01/14 17:04, Steve Albin <steve at steve-albin.com> a écrit :

> Isn't it faster to use a numeric index of the field rather than the name of
> the field as well as avoiding the casting of the field type?
> 
> Instead of:
> theCursor.Field("MessageBody").SetString theCleaner.execute
> 
> shouldn't it be 
> theCursor.varcharfield(1).value theCleaner.execute
> 
> Assuming the field is VarChar and in the first position of the cursor.  Not
> sure this would make a significant difference, but I think it is faster, no?
> 
> Steve
> 
> 
> --
> Steve Albin, Montclair, NJ
> http://www.steve-albin.com
> http://www.jazzdiscography.com
> 
> On Jan 11, 2014, at 10:53 AM, Jay Madren <jay at jaymadren.com> wrote:
> 
>> Well, updating a large text field across thousands of records is never going
>> to be instantaneous. How slow is too slow? (how long is it taking per 100 or
>> per 1000 records?)
>> 
>> What are you updating the message text with? Is it constant, or variable
>> depending on the message itself? If the changes can be formulated in SQL
>> only, then it could be faster. But I assume you're not using a vserver, so
>> the speed increase may be marginal.
>> 
>> 
>> On Sat, Jan 11, 2014 at 9:43 AM, Beatrix Willius <bwillius at gmx.de> wrote:
>> Database: version 5.5, Xojo 2013r4, 10.9
>> 
>> Class way: 
>> 
>> dim theCleaner as CleanerInterface
>> theCleaner = new CleaningMaster Œsome text options were selected here
>> theCleaner.setString theCursor.Field("MessageBody").GetString
>> theCursor.Field("MessageBody").SetString theCleaner.execute
>> theCursor.UpdateRecord
>> 
>> Multiuser: no
>> 
>> Size of records: couple of kb, can vary. This is the text version of an email
>> message that is handled here.
>> 
>> Selection of records to be updated: all. For my test I took a couple of
>> thousand mails from the old Realbasic mailing list, lots of newsletters and
>> some spam.
>> 
>> 
>> _______________________________________________
>> Valentina mailing list
>> Valentina at lists.macserve.net
>> http://lists.macserve.net/mailman/listinfo/valentina
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list