On 13 Jan 2012, at 8:45am, Ulf BJORKENGREN wrote: > I have a handful of quite populated tables that are only read, and two tables > with small number of rows that are written into. Right now it is all opened > as one readwriteable DB. > If I make the large tables into one readonly DB, and the other two into one > readwriteable DB, and the use ATTACH to add them together, would I then gain > performance due to less overhead in terms of journalling files? > I.e. will there not be any journaling of the readonly DB? > Would it make any difference in a WAL mode?
I don't think so. A SQLite database file is split into pages of a fixed length. Each page can have information about only one table in it. In other words, if you had a hundred tables, even if each table stored only a tiny bit of information, the database file would still need to use a hundred pages to store all that data. The journaling mechanism reflects only pages which have changed. So if you have tables in a database which don't change, they never use up any journal space. However, there are other reasons to use ATTACH. For instance, for security reasons you might want to keep the data which never changes in a file the user doesn't have privileges to change. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users