Speeding up UpdateRecord

Steve Albin steve at steve-albin.com
Sat Jan 11 10:04:33 CST 2014


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20140111/5abb39b4/attachment.html>


More information about the Valentina mailing list