views:

95

answers:

3

Hi, I have to manage a table on a large database with over 20k records (the db size is 25MB). I use standard queries like SELECT\INSERT etc. programmatically using SQLITE framework. But the app on the Device is VERY VERY slow. When I tap the icon, the Default.png freezes for 10-20 seconds and the app crashes. When I run it on the simulator (and when I build on the device from Xcode), the app does not crash but it takes too much time for loading and it's very slow to change views.

Is that a SQLITE problem? Can SQLITE manage large databases? If not I think I will have to migrate to the CoreData APi. If yes, I have to investigate on coding bugs...

Any help would be appreciated. Thank you!

A: 

The fact that your app crashes on launch and is slow to launch leads me to believe you're running out of memory. Are you by any chance loading the database file into memory?

Jeff Kelley
Yes, I'm loading the database file into memory because I need to have a vector of all the records (for search and browsing)...
kevin
In that case, I'm going to go with Roger on this one, since Core Data helps you out with the memory management.
Jeff Kelley
+1  A: 

Let coredata be your friend, I have an app with triple your data set and it runs as fast as you like.

Roger
Ok, I will ask for a date with Coredata tomorrow night :D I hope it will say Yes :P Any tutorial\docs suggestion?
kevin
A: 

I don't want to ruin your date, Kevin, but have you tried either bulk inserting (assuming this is possible on iPhone) or nesting your inserts in a transaction? Making every insert atomically will mean each is a transaction, and there will be a loss there (recalculate the btrees of each index every isert, etc).

MPelletier