问题
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