Closed touxiaoling closed 2 weeks ago
SQLite Pragma are only to be used when you know what they do.
Thank you for your response. Before modifying the pragmas parameters, I carefully read the SQLite pragma documentation at https://www.sqlite.org/pragma.html. According to the documentation:
Attempt to optimize the database. All schemas are optimized in the first two forms, and only the specified schema is optimized in the latter two.
In most applications, using PRAGMA optimize as follows will help SQLite to achieve the best possible query performance:
Applications with short-lived database connections should run "PRAGMA optimize;" once, just prior to closing each database connection.
Applications that use long-lived database connections should run "PRAGMA optimize=0x10002;" when the connection is first opened, and then also run "PRAGMA optimize;" periodically, perhaps once per day or once per hour.
All applications should run "PRAGMA optimize;" after a schema change, especially after one or more CREATE INDEX statements.
It can be seen that running optimize once at the end of the program is beneficial. As an alternative, I chose to run this parameter at the start of the program if the configuration takes effect.
Additionally, according to the documentation, the default value of optimize is 0xfffe, so I configured it as 0xfffe.
Furthermore, I tried directly executing the command sqlite3 ./komga/database.sqlite "PRAGMA optimize;" via the command line, and it seemed to work effectively. Therefore, I hope to add this to the configuration file for periodic execution.
Since I have a 800MB SQLite database, I expect this configuration to provide some benefits.
Although I am not sure why this setup did not take effect, thank you for your response..
Closing this.
Steps to reproduce
Expected behavior
The SQLite database will be optimized, and everything else should work smoothly.
Actual behavior
I’m unable to find my account in Komga.
Logs
No response
Komga version
1.14.1
Operating system
Truenas
Installation method
Docker
Other details
Hello, after reading the SQLite documentation, I found that it’s recommended to run PRAGMA optimize periodically. However, when I set application.yaml as shown below, I can’t access my existing account after starting Komga.Could anyone help me understand why this might be happening and suggest what I should do?
Acknowledgements