Slow write to sqlite on usb sticks

Peter Haworth pete at lcsql.com
Thu Apr 26 01:59:18 EDT 2012


Hi Terry,
Are you wrapping all 40 (or however many INSERTS) into one transaction?  By
which I mean there should be a BEGIN before the repeat loop starts and a
COMMIT after it finishes.  That definitely helps with performance and also
allows you to ROLLBACK if any of the INSERTs fail.

I doubt that would make fix the huge timing difference but worth a try if
you're not already doing it.

Only other thing I can think of is to try different combinations of LC and
the db on disk/USB - might narrow down which of the two is causing the
problem.

Pete
lcSQL Software <http://www.lcsql.com>



On Wed, Apr 25, 2012 at 6:57 PM, Terry Judd <terry.judd at unimelb.edu.au>wrote:

> We're finding that it's very slow to write even small amounts of data from
> Livecode to a sqlite file when the Livecode app and the db file are on a
> usb stick (the db stores a local copy of the user's messages as they are
> downloaded from a server). It seems to be something that is peculiar to the
> usb setup as it works very quickly when run from a hard drive (less that 1
> second for 40 messages vs 20-30 seconds on the usb stick). Has anyone
> experienced anything similar and/or does anyone have any suggestions as to
> how we might speed the process up?
>
> I'm currently downloading the messages (as xml), converting them to an
> array (from, to, subject, body, attachments etc.) and then writing each to
> the sqlite db within a repeat loop and then closing the db connection.
>
> Terry...
>
> _______________________________________________
> 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
>



More information about the use-livecode mailing list