3 ms·
It is a bit strange that the SQLite developers recommend SQLite as an application file format [0], but at the same time warn against opening database files from
by henrikeh 5y ago
It is a bit strange that the SQLite developers recommend SQLite as an application file format [0], but at the same time warn against opening database files from unknown sources [1]. In fact, their advice on using the `integrity_check` and `quick_check` pragma work against the performance advantage of using SQLite, as the entire database file now has to be read and parsed.
SQLite definitely still has advantages as a file format, but it would nice if there was bit more consistency in their messaging.
[0]: https://www.sqlite.org/appfileformat.html https://www.sqlite.org/appfileformat.html
[1]: https://www.sqlite.org/security.html#untrusted_sqlite_database_files https://www.sqlite.org/security.html#untrusted_sqlite_databa...
- smitty1e 5y agoI find the point sensible. SQLite is a fine internal storage format for an application. Of course if that storage is swapped among untrusted users, additional scrutiny is needful.
- henrikeh 5y agoIt totally is a sensible point. In fact, _all_ file formats, SQLite or not, has to deal with untrusted data, which will involve some kind of integrity check.
- henrikeh 5y agoI had some rather large SQLite databases so I just wanted to get a rough idea of the impact: Size (MB) Quick (s) Integrity (s) 8 0.061 0.47 76 0.39 1.8 582 2.8 13. 2926 14. 79. I tried my best to do the measurements with a cold filesystem cache, but this is by no means rigorous. For example, the databases for this test are roughly similar in schema and they all consist of many small rows. Few big rows might perform very differently.