How to implement table partitioning in Android (SQLite)?

独自空忆成欢 提交于 2019-12-25 04:42:41

问题


As I know, SQLite does not support table partitioning. However, when an application deals with big data, I think table partitioning is a good consideration. Unfortunately I can't find an example implementation to do this in Android until now. The condition would be as follows.

  • The table will grow over time
  • Old rows are rarely queried/updated; typical operation will be, but not limited to, searching or exporting/backing up to a file
  • Old rows are frequently queried for such a summary (e.g. by using aggregate function)

I am curious what approach is used by messaging apps or accounting apps to deal with it. So, how to do this in Android?

Thanks

UPDATE

I don't know the exact size it will be. Suppose that there are maximum of 200 entries in a day with an average 50 bytes per entry. In a year it will be 50 B × 200 × 365 = 3,650,000 B ≈ 3.48 MiB and in 10 years it can reach 34.81 MiB. I don't know whether it can be called as big data in Android. Someone said that cursor size could not exceed 1 MB.

来源:https://stackoverflow.com/questions/21364796/how-to-implement-table-partitioning-in-android-sqlite

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!