Will SQLite performance degrade if the database size is greater than 2 gigabytes?(如果数据库大小大于 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.
那么有没有人尝试使用最新版本的 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 性能会下降吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如果数据库大小大于 2 GB,SQLite 性能会下降吗?
基础教程推荐
- 带更新的 sqlite CTE 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
