Improve sqlite perfomance on iphone app
I have a Sqlite database table having 200K+ records. The database size is 25+MB. I have done indexing on search fields.
To search a particular word with a like search ( SELECT DISTINCT id, name FROM tbl WHERE name like 'something%' ) in SQLiteManager and in the iphone stimulator it take 0.2 - 0.3 seconds and in the device take little bit more. This is ok.
I just wanted to know is there any other DB than sqlite ( i have seen some apps use .pdb file ) which will make it much faster. Or is there any other way to handle large databases. ( like splitting the large tables in to several table etc )
Because in the next step i need to do complex searches. Actually I have done complex sql with combining two tables and the processing time is much higher ( 2 - 3 seconds in simulator and more than 4-5 seconds in the device )
Addition : Ok so I have decided to use core-data. But here comes the next question. Pre-populating the core-data. I have search several links in stackoverflow and other places and even in CoreDataBook sample app from apple ( http://developer.apple.com/library/ios/#samplecode/CoreDataBooks/ ) but all says copy it from one media to core-data ( xml, csv sqlite to core-data ) but in my case i have 25+MB database. If I do that then it will be 25+x2 MB. is there a way i can just populate the core-data manually ?
Ok populated the core-data db manually but result is same. ( there is a bil improvement but no开发者_Python百科t enough ) So any ideas to handle this huge database in iPhone app with faster results ?
Hey @Viraj you can download this video of Brad Larson and see how he used core data do make his app Pi-Cubed faster and with less amount of coding.
http://itunes.apple.com/us/itunes-u/advanced-iphone-development/id407243028
its 7th video named "core data" and its free.
精彩评论