Reverse a list

Mike Kerner MikeKerner at roadrunner.com
Tue Feb 17 17:20:57 EST 2015


I didn't include everything, including the transaction code, or opening the
database in memory instead of on a disk.  When we were messing with this,
the piece that became the (58 minute) bottleneck was inside the loop, or,
according to Peter, the way the chunks are accessed in the loop.

On Tue, Feb 17, 2015 at 4:21 PM, Dr. Hawkins <dochawk at gmail.com> wrote:

> On Tue, Feb 17, 2015 at 12:11 PM, Mike Kerner <MikeKerner at roadrunner.com>
> wrote:
>
> > The following is very fast:
> > put "INSERT INTO sortTest VALUES :1" into tSQL
> > repeat for each line tLine in tDataSet
> >    revExecuteSQL dbid, tsql, tline
> > end repeat
> >
>
> Faster still would probably be to build a command in the loop.  Terminate
> each line with ";" & cr
>
> Then put "BEGIN TRANSACTION;" & cr   before it, and "END TRANSACTION;" &
> cr   after it, and execute as a single command.
>
> However, I haven't used the :1 type syntax, and just don't know if it can
> handle that.
>
> put "BEGIN TRANSACTION;" & cr into dcmd
> repeat for each line tline in tDataSet
> put "INSERT INTO sortTest <something>" & ";"& cr after dcmd
> put "END TRANSACTION;" & cr after dcmd
>
> revExecuteSQL dbid, tcmd
>
>
>
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



-- 
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."



More information about the use-livecode mailing list