Make sure you use transactions. In my situation, minutes became seconds when I did that.
On Sep 11, 4:51 am, Albert <[email protected]> wrote: > SQLite DBs are very fast, it takes less than half a second to insert a > record/records. 1000 records is a lot! I haven't seen your code but > what you should do is: > > openDatabase once > insert all records > close DB > > Avoid open/close database 1000 times. Also the GC is probably very > busy during the operation so look for optimizations(avoid unnecessary > object creation, StringBuilder instead of String when appropiate, > etc...) > > Hope this helps! > > Alberto > > On Sep 11, 4:41 am, ls02 <[email protected]> wrote: > > > > > I need to insert 1000 rows into SQLite DB. Each row has 12 columns, > > text and numbers, none is big. It takes literraly minutes to insert > > all 1000 items. I use SQLiteDatabase.insert to insert each row. > > > What can I do to improve this performance?- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

