连接时,SQLite是否将整个数据库文件加载到内存中? [英] Does SQLite load whole db file into memory when connected?

查看:492
本文介绍了连接时,SQLite是否将整个数据库文件加载到内存中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道数据库是否在Android设备中效率更高,或者只是普通的json文件,如果它在Android设备中有很多项目。

I want to know is Database more efficient or just a normal json file if it has many items, in android device.

推荐答案

否,Sqlite将通过分页读取硬盘数据。
Sqlite文档说:
为了将数据从数据库返回给用户,例如作为SELECT查询的结果,SQLite必须在某些时候从数据库文件中读取数据。通常,数据以页面大小的字节对齐块的形式从数据库文件中读取。

No, Sqlite will read data for hard disk by paging. The Sqlite document said: "In order to return data from the database to the user, for example as the results of a SELECT query, SQLite must at some point read data from the database file. Usually, data is read from the database file in aligned blocks of page-size bytes. "

链接: https://www.sqlite.org/fileio.html

这篇关于连接时,SQLite是否将整个数据库文件加载到内存中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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