Hi All,
I am building an iPhone app which has a quite big SQLite database. In order to make it lighter I thought I could delete the Primary index, and then add it on the first launch. How is would that be possible ?
Thank you
Hi All,
I am building an iPhone app which has a quite big SQLite database. In order to make it lighter I thought I could delete the Primary index, and then add it on the first launch. How is would that be possible ?
Thank you
Assuming that you have verified that this is worthwhile (is the DB really that much bigger with an index than without?)
In your preferences bundle of the application, set a flag for 'first-run'. When the application runs, check for the existence of this field (and that it is set). If those conditions are met, run the indexing code. When complete, unset the flag and delete the flag.
Now, on subsequent invocations of the app, when it checks for the flag, it will not be found and so the indexing will not run again.