Bug 515061 - Speed up startup
Summary: Speed up startup
Status: REPORTED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Mysql (other bugs)
Version First Reported In: 8.8.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-25 15:44 UTC by Alessandro Cini
Modified: 2026-01-25 16:40 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Log file (45.46 KB, text/plain)
2026-01-25 16:40 UTC, Alessandro Cini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Cini 2026-01-25 15:44:11 UTC
SUMMARY
The startup of digikam is a little too slow. It takes like 25 seconds if I use mySql.
I just noticed that it seems to depend by a huge number of queries the program does for every picture (it perform 8604 times with different ID this query: "SELECT Images.name, Albums.albumRoot, Albums.relativePath, Albums.id FROM Images  INNER JOIN Albums ON Albums.id=Images.album   WHERE Images.id="
Is there some way to avoid this? Maybe loading a part on windows startup or asking to the program to don't do all these check at startup.
Thanks

STEPS TO REPRODUCE
1. Startup digikam program with mySql DB
2. Turn on Log on mySQL with SET GLOBAL GENERAL-LOG='ON';
3. Check the file in C:\Program Files\MariaDB 11.7\data\[COMPUTERNAME].log

OBSERVED RESULT
Many db search

EXPECTED RESULT
Less db search -> Faster startup

SOFTWARE/OS VERSIONS
Windows: Windows 10
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Things like this are duplicated many times
		   160 Execute	SELECT tagid FROM ImageTags WHERE imageID=48258
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=21
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=31
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=226
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=231
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=244
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=247
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=275
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=293
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=316
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=350
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=354
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=401
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=405
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=417
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=443
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=960
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1168
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1171
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1172
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1173
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1174
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1176
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1178
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1179
		   160 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1358
		   160 Close stmt	
		   168 Prepare	SELECT Images.name, Albums.albumRoot, Albums.relativePath, Albums.id FROM Images  INNER JOIN Albums ON Albums.id=Images.album   WHERE Images.id=?
		   168 Reset stmt	
		   168 Execute	SELECT Images.name, Albums.albumRoot, Albums.relativePath, Albums.id FROM Images  INNER JOIN Albums ON Albums.id=Images.album   WHERE Images.id=54014
		   168 Close stmt	
		   160 Prepare	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=? AND tagid=?
		   160 Reset stmt	
		   160 Execute	SELECT tagid, property, value FROM ImageTagProperties WHERE imageid=48258 AND tagid=1359
Comment 1 caulier.gilles 2026-01-25 15:54:29 UTC
Did you double check first if all startup options from the Setup/Miscs/Behaviors are turn off:

https://docs.digikam.org/en/setup_application/miscs_settings.html#behavior-settings
Comment 2 Maik Qualmann 2026-01-25 16:17:03 UTC
Do we simply omit database queries, and digiKam will function just like before, only faster?
These queries are necessary and certainly not the issue in terms of speed.

Please create a DebugView log from the start of digiKam, as described here for Windows:

https://www.digikam.org/contribute/#windows-host

Maik
Comment 3 Alessandro Cini 2026-01-25 16:22:17 UTC
(In reply to caulier.gilles from comment #1)
> Did you double check first if all startup options from the
> Setup/Miscs/Behaviors are turn off:
> 
> https://docs.digikam.org/en/setup_application/miscs_settings.html#behavior-
> settings

Yes, they are all off
Comment 4 Alessandro Cini 2026-01-25 16:40:20 UTC
Created attachment 188869 [details]
Log file

Log file from debugview