4 ms·
An SQLite database is just a file. You can build the empty database with schema and base values ahead of time, save it to a file (or an in-memory byte buffer) a
by ndepoel 5y ago
An SQLite database is just a file. You can build the empty database with schema and base values ahead of time, save it to a file (or an in-memory byte buffer) and then every time you want to create a new database, you just copy that file. No need to do any expensive initialization queries that way. If raw high-speed throughput is needed, skipping that step can make a significant difference.
- deleted 5y ago[deleted]
- tyingq 5y agoYes, that approach makes sense. I thought what I was replying to was suggesting writing b-tree pages themselves, outside of sqlite, for the new data.
- emmelaich 5y agoI guess if you wanted the fastest creation you could make a custom backend format for sqlite and use that. Especially if query speed was not important.