Bug 322642 - MAINTENANCE : tools an optimizations to maintain database schema
Summary: MAINTENANCE : tools an optimizations to maintain database schema
Alias: None
Product: digikam
Classification: Unclassified
Component: Database-Schema (show other bugs)
Version: 3.2.0
Platform: Other Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Digikam Developers
Depends on:
Reported: 2013-07-21 06:59 UTC by Philipp Hahn
Modified: 2016-07-16 13:11 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:

tag recovery procedure (6.53 KB, text/plain)
2013-07-21 07:01 UTC, Philipp Hahn

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn 2013-07-21 06:59:41 UTC
After a crash of digikam the Tags table was corrupted: the lft and rgt values were inconsistend and several old tags were missing.
I was able to re-construct most of the table by hand.

Reproducible: Didn't try

Steps to Reproduce:
1. After GPS correlating several pictures I used the feature to reverse-tag those pictures. For some new cities multiple tags were created.
2. I removed some of those duplicate tags.
3. Digikam consumed 100% for a very long time, so I termincated it
4. After a restart several tags were missing: As one country tag was removed, all subtags were missing as well. They were still in the table, but unreachable.

The Tags-table corruption is similar to Bug 298929. I was able to re-insert most of the missing tags by hand and re-constructing the lft,rgt values by following <http://stackoverflow.com/questions/3623645/how-to-repair-a-corrupted-mptt-tree-nested-set-in-the-database-using-sql>

Bug 309061 describes a bug when deleting tags.
Comment 1 Philipp Hahn 2013-07-21 07:01:14 UTC
Created attachment 81232 [details]
tag recovery procedure
Comment 2 caulier.gilles 2013-10-31 07:52:24 UTC
digiKam 3.5.0 is out.

Can you give a fresh feedback about your report ? Crash still reproducible ?

Thanks in advance

Gilles Caulier
Comment 3 Philipp Hahn 2013-11-09 15:41:18 UTC
(In reply to comment #2)
> Can you give a fresh feedback about your report ? Crash still reproducible ?

I hope to never get in that situation again, as reconstructing the tree by hand did cost me several days. Perhaps killing digikam by "kill -9" while a tag-tree modification is in process can reproduce it?
Comment 4 caulier.gilles 2014-05-16 07:29:00 UTC
digiKam 4.0.0 is out :


Please check if this entry still valid with this new version.

Thanks in advance

Gilles Caulier
Comment 5 caulier.gilles 2014-08-14 10:08:58 UTC
A work around to maintain sqlite database file have been given in users mailing lits :




These kind of maintenance operation must be done through a dedicated tool in digiKam.

Gilles Caulier
Comment 6 caulier.gilles 2014-08-21 08:19:19 UTC
Another optimization of SQlite database is given here :


It's an performance tune of SQlite settings.

Gilles Caulier