Android 上 SQLite 数据库的最大大小是多少? [英] What is a maximum size of SQLite database on Android?

查看:77
本文介绍了Android 上 SQLite 数据库的最大大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大小超过 2.6 GiB 的 SQLite 数据库.(数据库包含地图.)该数据库由 RMaps 应用程序使用.当以最大缩放将地图移动到某些部分时,应用程序突然关闭.但是,没有强制关闭消息,也没有报告按钮.所以,我有一个想法,它是由读取超出某个限制的块引起的,例如最大值(整数).由于 RMaps 只是使用简单的 SQL 语句,所以我认为问题不在 RMaps 中,而是在 Android SQLite 驱动程序中.

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.

Android 上的 SQLite 数据库有大小限制吗?

Is there a size limit of SQLite database on Android?

(我在 Nexus One 上有 Froyo,但我不认为这只是 Froyo 的问题.)

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

日志输出:

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}

SQLite db 存储在 SD 卡上,有足够的空间.

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

推荐答案

字符串或 BLOB 的最大长度 默认大小为 1 GB 最大大小为 2.147483647

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

最大列数默认大小为 2000 最大大小为 32767

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

SQL 语句的最大长度默认大小为 1 MB 最大大小为 1.073741824

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

连接中的最大表数默认为 64 个表

Maximum Number Of Tables In A Join Default is 64 tables

最大附加数据库数默认为 10 最大大小为 125

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

表中最大行数最大为 18446744073.709552765

Maximum Number Of Rows In A Table Max Size is 18446744073.709552765

最大数据库大小 140 tb,但这取决于您的设备磁盘大小.

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

这篇关于Android 上 SQLite 数据库的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆