开发者

Deleting the primary index of a SQLite database

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜