Re:How the SQLite virtual machine works
by simonw on Wednesday September 07, 2022 @04:35PM
(#32756436)
What are the other problems?
Re:How the SQLite virtual machine works
by chasil on Wednesday September 07, 2022 @06:27PM
(#32757940)
OK, I'll download the PDF onto my phone and get the quote...
...I forgot how significant these problems are. These are quite serious.
"However, WAL mode has notable disadvantages. To accelerate searching the WAL, SQLite creates a WAL index in shared memory. This improves the performance of read transactions, but the use of shared memory requires that all readers must be on the same machine. Thus, WAL mode does not work on a network filesystem. It is not possible to change the page size after entering WAL mode. In addition, WAL mode comes with the added complexity of checkpoint operations and additional files to store the WAL and the WAL index."
https://vldb.org/pvldb/volumes/15/paper/SQLite%3A%20Past%2C%...
Re:How the SQLite virtual machine works
by yread on Wednesday September 07, 2022 @06:50PM
(#32758204)
It also complicates backups. I have another process that .backups the database but even when opening it in read-only it creates a .wal file. My first version of the backup script didn't delete it afterwards and the normal process didn't have the right to overwrite the backup's wal file so opening the db failed
Re:How the SQLite virtual machine works
by chasil on Wednesday September 07, 2022 @07:19PM
(#32758565)
Maybe adjust the umask of the backup process?
Re:How the SQLite virtual machine works
by gigatexal on Wednesday September 07, 2022 @03:59PM
(#32755915)
How often is attach really used though?
Re:How the SQLite virtual machine works
by chasil on Wednesday September 07, 2022 @04:34PM
(#32756431)
How often are distributed transactions used elsewhere with two-phase commit?
All the time. I suspect this is similar.
Re:How the SQLite virtual machine works
by gigatexal on Wednesday September 07, 2022 @05:52PM
(#32757493)
Right but that’s bending SQLite a lot no? I mean it’s meant to be used as a file that has a sql interface. But I digress.
Re:How the SQLite virtual machine works
by taberiand on Thursday September 08, 2022 @01:40AM
(#32761606)
I wonder how many times SQLite has been passed over for a more complex solution because people thought they needed highly scalable distributed two phase commit or whatever when all they really needed was a file with an SQL interface
The chief problem that I see with WAL is that it breaks ACID with databases that are ATTACHed, as the documentation shows:
https://sqlite.org/lang_attach.html