How to reduce the size of an sqlite3 database for iphone?

后端 未结 11 1711
没有蜡笔的小新
没有蜡笔的小新 2020-12-31 20:06

edit: many thanks for all the answers. Here are the results after applying the optimisations so far:

  • Switching to sorting the characters and run l
11条回答
  •  滥情空心
    2020-12-31 21:06

    As mentioned elsewhere, lose the indexes on the boolean columns, they will almost certainly be slower (if used at all) than a table scan and are going to use space needlessly.

    I'd consider applying a simple compression to the words, Huffman coding is pretty good for this sort of thing. Also, I'd look at the signatures: sort the columns in letter frequency order and don't bother storing trailing zeroes, which can be implied. I guess you could Huffman-encode those, too.

    Always assuming your encoded strings don't upset SQLite, of course.

提交回复
热议问题