问题描述
去年我在他们的网站上查看 SQLite 时,推荐的 SQLite 数据库大小为 2 GB.但是现在,我再也找不到那个推荐了.
Last year when I checked about SQLite on their web site, the recommended SQLite database size was 2 gigabytes. But now, I could not find that recommendation again.
那么有没有人尝试使用最新版本的 SQLite 数据库来处理大于 2 GB 的 SQLite 数据库?SQLite 的表现如何?
So has anyone tried to work with an SQLite database that is bigger than 2 gigabytes using latest version of it? How well did SQLite perform?
P.S:我想做一个需要在本地运行的大型数据库(例如存储维基百科文章)的移动应用程序.
P.S: I would like to make a mobile application that requires big database (for example storing Wikipedia articles) that works locally.
推荐答案
没有 2 GB 的限制.
There is no 2 GB limit.
SQLite 数据库文件的最大大小约为 140 TB.
SQLite database files have a maximum size of about 140 TB.
在手机上,存储空间的大小(几 GB)会限制您的数据库文件大小,而内存大小将限制您可以从查询中检索的数据量.此外,Android 游标的结果限制为 1 MB.
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.
数据库大小本身不会影响您的性能.只要查询访问的数据不超过数据库的页面缓存(默认为 2 MB).
The database size will, by itself, not affect your performance. Your queries will be fast as long as they do not access more data than fits into the DB's page cache (2 MB by default).
这篇关于如果数据库大小大于 2 GB,SQLite 性能会下降吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!