如果数据库大小大于2 GB,SQLite的性能会降低吗? [英] Will SQLite performance degrade if the database size is greater than 2 gigabytes?

查看:398
本文介绍了如果数据库大小大于2 GB,SQLite的性能会降低吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

去年,当我在他们的网站上检查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.

那么,有没有人尝试使用最新版本的大于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:我想制作一个移动应用程序,该应用程序需要在本地工作的大型数据库(例如,存储Wikipedia文章).

P.S: I would like to make a mobile application that requires big database (for example storing Wikipedia articles) that works locally.

推荐答案

没有2 GB的限制.

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的性能会降低吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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