如果数据库大小大于 2 GB,SQLite 性能会下降吗?

2023-06-25数据库问题
17

本文介绍了如果数据库大小大于 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 性能会下降吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

SQL 子句“GROUP BY 1"是什么意思?意思是?
What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)...
2024-04-16 数据库问题
62

如何在MySQL中为每个组选择第一行?
How to select the first row for each group in MySQL?(如何在MySQL中为每个组选择第一行?)...
2024-04-16 数据库问题
13

MySQL - 获取最低值
MySQL - Fetching lowest value(MySQL - 获取最低值)...
2024-04-16 数据库问题
8

在 cmakelist.txt 中添加和链接 mysql 库
Add and link mysql libraries in a cmakelist.txt(在 cmakelist.txt 中添加和链接 mysql 库)...
2024-04-16 数据库问题
41

考勤数据库的良好数据库设计(架构)是什么?
What is a good database design (schema) for a attendance database?(考勤数据库的良好数据库设计(架构)是什么?)...
2024-04-16 数据库问题
7

子类型的表关系
Table relationship for subtypes(子类型的表关系)...
2024-04-16 数据库问题
10