SQLite database maximum storage capacity
Asked Answered
D

2

15

How many records in an SQLite database can we maximally store? Is there any limitation? If the data goes beyond this limitation what type of error does it give? Will the whole the system fail, or what else happens?

Dexter answered 14/12, 2011 at 9:26 Comment(1)
Related: #3483135Faugh
G
14

Based on this page:

Android does not impose any limitations beyond the standard SQLite concepts. We do recommend including an autoincrement value key field that can be used as a unique ID to quickly find a record. This is not required for private data, but if you implement a content provider, you must include a unique ID using the BaseColumns._ID constant.

The limit is tied to SQLite limitation. As for what happened when we hit that limit, I guess android will raise SQLiteFullException.

Gaucherie answered 14/12, 2011 at 9:31 Comment(2)
Thanks @silent, If i store 1 0r 2 days Location information on sqlite for peridiocity of 15 minutes , will it become full? How can i truncate the table if database become full?Dexter
4*24 = 96 entry / day = 1.000.000.000 / 96 = ~28500 years. I think, for your situation, you will never have to truncate. However, you can still do DELETE * FROM yourtable, to truncate it's data.Gaucherie
I
4

Its 140 terabytes Maximum . In more details

SQLite was originally designed with a policy of avoiding arbitrary limits. Of course, every program that runs on a machine with finite memory and disk space has limits of some kind. But in SQLite, those limits were not well defined. The policy was that if it would fit in memory and you could count it with a 32-bit integer, then it should work.

Inchoate answered 8/2, 2012 at 12:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.