Bug 456024 - Use Write-Ahead-Logging as default journalling mode
Summary: Use Write-Ahead-Logging as default journalling mode
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Sqlite (show other bugs)
Version: 7.6.0
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-27 10:23 UTC by zilexa
Modified: 2022-08-14 17:26 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.0.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zilexa 2022-06-27 10:23:45 UTC
SUMMARY
***
Each Digikam db still uses "delete" journalling mode, while WAL was introduced in 2010 and is over and over again confirmed to be more efficient. Especially on Linux with EXT4 or BTRFS filesystem users will benefit from changing journal mode to WAL instead of delete. 
***


STEPS TO REPRODUCE
1. Please find benchmark results here. https://wiki.tnonline.net/w/Blog/SQLite_Performance_on_Btrfs
2.  Note although these are specific for BTRFS filesystem as it will benefit even more because it is a CoW filesystem, EXT4 will benefit too. This is not a btrfs-specific request, although constant DB changes do require btrfs users to change journal mode to WAL. 


OBSERVED RESULT
See results here: https://wiki.tnonline.net/w/Blog/SQLite_Performance_on_Btrfs

EXPECTED RESULT
- improved performance on EXT4
- required for BTRFS

SOFTWARE/OS VERSIONS
All Linux systems using EXT4 or BTRFS filesystem. 

ADDITIONAL INFORMATION
Note every other software I come across already uses journal_mode=WAL instead of journal_mode=delete.
I requested this over a year ago through the mailing list as well as it seems like a trivial thing to do. 
Users can do it manually, but should not be required to do so.
Comment 1 Maik Qualmann 2022-06-27 11:32:47 UTC
*** This bug has been marked as a duplicate of bug 435070 ***
Comment 2 Maik Qualmann 2022-06-27 11:49:17 UTC
Please do not submit bug reports twice.
You can easily enable SQLite WAL mode yourself with the sqlite3 command line tool and let's see digiKam working with it. There are not only positive reports about it, data loss, aggravated lock problem. I've had my eye on the WAL mode for a long time, but so far I haven't been able to bring myself to offer it as a standard in digiKam or as an option.

Maik
Comment 3 Maik Qualmann 2022-08-14 17:26:21 UTC
Git commit ccca2deb3773313832591d1226574ee8aaa72f92 by Maik Qualmann.
Committed on 14/08/2022 at 17:24.
Pushed by mqualmann into branch 'master'.

add database option to enable SQLite WAL mode support
Related: bug 435070
FIXED-IN: 8.0.0

M  +2    -2    NEWS
M  +4    -2    core/libs/album/manager/albummanager_database.cpp
M  +9    -5    core/libs/database/coredb/coredbaccess.cpp
M  +63   -0    core/libs/database/engine/dbenginebackend.cpp
M  +5    -0    core/libs/database/engine/dbenginebackend.h
M  +15   -1    core/libs/database/engine/dbengineparameters.cpp
M  +2    -0    core/libs/database/engine/dbengineparameters.h
M  +7    -3    core/libs/database/similaritydb/similaritydbaccess.cpp
M  +7    -3    core/libs/database/thumbsdb/thumbsdbaccess.cpp
M  +13   -1    core/libs/database/utils/widgets/dbsettingswidget.cpp
M  +4    -0    core/libs/database/utils/widgets/dbsettingswidget_p.h
M  +4    -0    core/libs/facesengine/facedb/facedbaccess.cpp

https://invent.kde.org/graphics/digikam/commit/ccca2deb3773313832591d1226574ee8aaa72f92