Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a maximum size of SQLite database on Android?

I have a SQLite db that size is over 2.6 GiB. (The db contains maps.) This db is used by RMaps app. When move the maps to some parts at maximum zoom, the app suddenly closes. However, there is no force close message, no report button. So, I've got an idea that it is caused by reading blocks that are beyond a certain limit e.g. max(int). Since RMaps is just using simple SQL statements, I think that the problem is not in RMaps but rather in Android SQLite driver.

Is there a size limit of SQLite database on Android?

(I have Froyo on Nexus One, but I do not think that this is just a problem of Froyo.)

Log output:

08-14 10:24:51.689 I/ActivityManager(   81): Starting activity: Intent { act=android.intent.action.SEARCH flg=0x10000000 cmp=com.robert.maps/.MainMapActivity (has extras) } 08-14 10:25:01.879 E/AndroidRuntime(12441): FATAL EXCEPTION: pool-1-thread-2 08-14 10:25:01.879 E/AndroidRuntime(12441): android.database.sqlite.SQLiteDiskIOException: disk I/O error 08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:70) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:283) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:264) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:171) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:248) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at com.robert.maps.utils.CashDatabase.getTile(CashDatabase.java:49) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at org.andnav.osm.views.util.OpenStreetMapTileFilesystemProvider$7.run(OpenStreetMapTileFilesystemProvider.java:501) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561) 08-14 10:25:01.879 E/AndroidRuntime(12441):     at java.lang.Thread.run(Thread.java:1096) 08-14 10:25:01.889 I/ActivityManager(   81): Process com.robert.maps (pid 12441) has died. 08-14 10:25:01.899 I/WindowManager(   81): WIN DEATH: Window{45131410 com.robert.maps/com.robert.maps.MainMapActivity paused=false} 

The SQLite db is stored on SD card, there is enough space.

like image 599
TN. Avatar asked Aug 14 '10 08:08

TN.


People also ask

What is the maximum size of SQLite database?

SQLite database files have a maximum size of about 140 TB. On a phone, the size of the storage (a few GB) will limit your database file size, while the memory size will limit how much data you can retrieve from a query. Furthermore, Android cursors have a limit of 1 MB for the results.

Is SQLite good for Android?

SQLite is cross-platform which means that it can be used on Android application built on Java, and as well as cross-platform application built on React Native.

What is SQLite database storage in Android?

What is SQLite Database? SQLite Database is an open-source database provided in Android which is used to store data inside the user's device in the form of a Text file. We can perform so many operations on this data such as adding new data, updating, reading, and deleting this data.

What is considered a large database?

The most common definition of VLDB is a database that occupies more than 1 terabyte or contains several billion rows, although naturally this definition changes over time.


1 Answers

Maximum length of a string or BLOB Default size is 1 GB Max size is 2.147483647

Maximum Number Of Columns Default size is 2000 Max size is 32767

Maximum Length Of An SQL Statement Default size is 1 MB Max size is 1.073741824

Maximum Number Of Tables In A Join Default is 64 tables

Maximum Number Of Attached Databases Default is 10 Max size is 125

Maximum Number Of Rows In A Table Max Size is 18446744073.709552765

Maximum Database Size 140 tb but it will depends on your device disk size.

like image 115
Pravin Bhosale Avatar answered Oct 02 '22 00:10

Pravin Bhosale