Bug 473355

Summary: Big trash bin freezes digikam for long time
Product: [Applications] digikam Reporter: Michael <mas_masterandservant>
Component: Albums-TrashAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles
Priority: NOR    
Version First Reported In: 8.1.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In: 8.2.0
Sentry Crash Report:
Attachments: Screenshot during freeze

Description Michael 2023-08-14 08:59:22 UTC
Created attachment 160942 [details]
Screenshot during freeze

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

I am running digikam's sqlitedb on a SSD. Everything is fast enough and response times are great for me, even if I have to wait some minutes. But now I have to wait for a very long time.

STEPS TO REPRODUCE
1. Have a huge db with >1.000.000 images
2. Remove >80.000 images with a search for duplicates. Can be done in several steps.
3. Select the album trash

OBSERVED RESULT
Digikam freezes until some background work is done. I do not know which. It takes more than 2 hours in my case. After that digikam works normal again and I can work with it.

EXPECTED RESULT
Album trash opens faster like my biggest albums with > 80.000 images

SOFTWARE/OS VERSIONS
Windows: WIN 11
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION

Thanks for this great software!

Greetings

Michael
Comment 1 caulier.gilles 2023-08-14 12:38:10 UTC
I think this can be due to wrong thumbnail cache settings or something like that.

With trash, database is not used so not thumbnails-database usage at all, but we can use the free-desktop alternative for that. 

Gilles
Comment 2 Michael 2023-08-14 15:14:28 UTC
My workaround is to delete the ".dtrash" folder directly by the windows file explorer. So I assume that it takes so long, cause digikam has to read all data from the files in .dtrash again. The .dtrash does not live on a SDD like the SQLiteDB. It it lives on a simple, old mobile HDD. Maybe I should simply empty the trash more often. With <10.000 images it is working pretty good.
Comment 3 Maik Qualmann 2023-08-14 19:47:19 UTC
Git commit 4d9f1b97fe2d04c71e4e6049ceaed79129c67198 by Maik Qualmann.
Committed on 14/08/2023 at 21:46.
Pushed by mqualmann into branch 'master'.

disable model sorting when loading DTrash items
FIXED-IN: 8.2.0

M  +11   -1    NEWS
M  +15   -7    core/libs/dtrash/dtrashitemmodel.cpp
M  +4    -0    core/libs/dtrash/dtrashitemmodel.h

https://invent.kde.org/graphics/digikam/-/commit/4d9f1b97fe2d04c71e4e6049ceaed79129c67198