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

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

问题描述

我有一个SQLite数据库的大小超过2.6吉布。 (该数据库中包含的地图。) 该数据库所使用的RMaps应用程序。当移动地图,在最大变焦某些部分,应用程序突然关闭。然而,没有强制关闭的消息,不报告按钮。所以,我已经有了,它是由读书块,超出一定限度,例如一个想法MAX(INT)。由于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.

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

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的数据库存储在SD卡,有足够的空间。

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

推荐答案

我怀疑它是〜2千兆字节(这可能是由于32位架构,虽然某些程序都与largefile支持,让更多的那个)。幸运的是 android.database.sqlite.SQLiteDatabase 有以下API调用返回数据库可能长到最大尺寸:

I suspect it is ~2 gigabytes (that might be due to 32-bit architecture, although certain programs come with largefile support, allowing more that that). Fortunately android.database.sqlite.SQLiteDatabase has following API call that returns the maximum size the database may grow to:

long getMaximumSize()

最后,你可能想看看数据库拆分;)

Eventually you might want to look into database sharding ;)

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

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