且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

连接时,SQLite是否将整个数据库文件加载到内存中?

更新时间:2023-02-07 10:07:36

否,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