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

后端 未结 11 1712
没有蜡笔的小新
没有蜡笔的小新 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 20:53

    As noted storing "Signature" more efficiently seems like a good idea.

    However, it also seems like you could gain a ton of space savings by using some kind of lookup table for words - since you seem to be taking a root word and then appending "er", "ed", "es", etc why not have a column with a numeric ID that references a root word from a separate lookup table, and then a separate column with a numeric ID that references a table of common word suffixes that would be appended to the base word.

    If there were any tricks around storing shorthand versions of signatures for multiple entries with a single root word, you could also employ those to reduce the size of stored signatures (not sure what algorithm is producing those values)

    This also seems to make a lot of sense to me as you have the "word" column as a primary key, but do not even index it - just create a separate numeric column that is the primary ID for the table.

提交回复
热议问题