Does SQLite load whole db file into memory when connected?

前端 未结 2 1502
耶瑟儿~
耶瑟儿~ 2021-02-19 19:18

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

2条回答
  •  被撕碎了的回忆
    2021-02-19 19:40

    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. "

    Link: https://www.sqlite.org/fileio.html

提交回复
热议问题