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 性能会下降吗?


- 导入具有可变标题的 Excel 文件 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01