Bug 391840

Summary: Timeline does not show any pictures if range is too big
Product: [Applications] digikam Reporter: MarcP <iwannaberich>
Component: Searches-TimeLineAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, iwannaberich, metzpinguin
Priority: NOR    
Version: 5.9.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
URL: https://imgur.com/a/cNsxR
Latest Commit: Version Fixed In: 6.2.0
Sentry Crash Report:

Description MarcP 2018-03-14 01:10:09 UTC
In the timeline panel, it is possible to select a range of dates, and all the pictures within that range are displayed in the thumbnail view. However, if the range is too wide, no picture is displayed. I guess it has to do with the amount of pictures in the selection.

This is important since selecting the whole time range is the only possible way to see and filter pictures from all collections at once.

I have attached a couple of screenshots, one showing that the range 2010-2018 works, but the range 2009-2018 doesn't. They can be seen here: https://imgur.com/a/cNsxR
Comment 1 Maik Qualmann 2018-03-14 05:58:36 UTC
I can not reproduce the problem. I have selected an range from 2005-2018 and the images are displayed. Depending on the number of displayed images, it may take a while for the result to appear. But that's another problem when filling the Icon view with such a large number of images and a bug report already exists.

Maik
Comment 2 MarcP 2018-03-14 06:27:24 UTC
In this case, I can tell that it is not because digikam is still loading all the items, since if that was the case, it would become a bit irresponsive for a few seconds. 

When selecting more than 60000 pictures, it just stops loading them. No irresponsivenes or sluggishness, no high cpu usage, just an empty list. Maybe the database query has some kind of limit on the number of elements it can return?

I fired DebugView to see if I could see some useful message. This is what I saw when it fails to load the items:
https://pastebin.com/bA3SguKW

Notice the 'Prepare failed!' and 'Failed to list url: " "'. These two messages take less than a second to appear.

As a comparison, this is what it shows when a selection works properly: https://pastebin.com/84hbhVsU
Comment 3 caulier.gilles 2018-03-14 08:37:05 UTC
Maik,

I remember an old limitation in imagelister mechanism, but is don't found again it in source code. In my memory, I would said something around 1024 items...

IWBR,

To investigate more, it will be interesting to see the level of items when the database do not return a response. So selecting the range of date to change the expected amount of items returned will indicate when the database will not respond to the query.

Gilles Caulier
Comment 4 caulier.gilles 2018-03-14 08:40:42 UTC
MAik, 

Look in core/libs/database/items/imagelisterreceiver.cpp::ImageListerJobGrowingPartsSendingReceiver::receive().

What is that :

m_limit
m_maxLimit

???

Gilles
Comment 5 MarcP 2018-03-14 18:18:10 UTC
Gilles,

I am not sure if that is what you asked, but the database stopped responding at some point between the selection of 68438 (works just fine) and 72600 elements (empty response). That was the most I could narrow it down, since it's a very slow process.
Comment 6 Maik Qualmann 2018-03-14 22:08:23 UTC
I'll take a look at it in the next few days. Was not there something with only 200 items in the block reading, so that the GUI does not freeze?

Maik
Comment 7 Maik Qualmann 2018-10-07 13:49:02 UTC
Git commit f27ab9c1051bd0a0bba6e79bc77899c74a7e6bf8 by Maik Qualmann.
Committed on 07/10/2018 at 13:47.
Pushed by mqualmann into branch 'master'.

add a global cache for grouped images
When we load the images into the Icon view,
we ask each time, whether there are grouped
images, with 30000 images in the view are that
also 30000 SQL query.
With this patch, the time to load a view with
many images is faster with MySQL 3x and with SQLite 2x.
Related: bug 398921, bug 396086, bug 397901

M  +24   -0    core/libs/database/coredb/coredb.cpp
M  +5    -0    core/libs/database/coredb/coredb.h
M  +1    -10   core/libs/database/item/imageinfo.cpp
M  +19   -2    core/libs/database/item/imageinfocache.cpp
M  +7    -0    core/libs/database/item/imageinfocache.h
M  +0    -3    core/libs/database/item/imageinfodata.h

https://commits.kde.org/digikam/f27ab9c1051bd0a0bba6e79bc77899c74a7e6bf8
Comment 8 Maik Qualmann 2019-01-03 19:47:13 UTC
Git commit abd32eefb24ac94c6a5343869578eabdd9ec9f9d by Maik Qualmann.
Committed on 03/01/2019 at 19:43.
Pushed by mqualmann into branch 'master'.

use ReadWriteLock for the CollectionManager
Loading a large item view is now about 4x
faster here with MySQL
Related: bug 391115

M  +9    -9    core/libs/database/collection/collectionmanager_album.cpp
M  +43   -39   core/libs/database/collection/collectionmanager_location.cpp
M  +2    -0    core/libs/database/collection/collectionmanager_p.h

https://commits.kde.org/digikam/abd32eefb24ac94c6a5343869578eabdd9ec9f9d
Comment 9 Maik Qualmann 2019-04-22 18:37:52 UTC
Git commit 1f8edbda8bff2a3e201b8870a686f0066e20d590 by Maik Qualmann.
Committed on 22/04/2019 at 18:35.
Pushed by mqualmann into branch 'master'.

use QReadWriteLock for the CollectionManager
Loading a large item view is now about 4x
faster here with MySQL
Related: bug 398921, bug 397901, bug 391115

M  +12   -13   core/libs/database/collection/collectionmanager.cpp
M  +1    -1    core/libs/database/collection/collectionmanager.h
M  +11   -9    core/libs/database/collection/collectionmanager_album.cpp
M  +118  -107  core/libs/database/collection/collectionmanager_location.cpp
M  +1    -1    core/libs/database/collection/collectionmanager_p.cpp
M  +2    -0    core/libs/database/collection/collectionmanager_p.h
M  +1    -1    core/libs/database/coredb/coredbaccess.cpp

https://invent.kde.org/kde/digikam/commit/1f8edbda8bff2a3e201b8870a686f0066e20d590
Comment 10 MarcP 2019-06-27 16:39:56 UTC
I no longer have this issue, at least using the linux version of Digikam (in my new computer I don't have a windows installation, so I can't try it). If it were for me, you can close it.
Comment 11 Maik Qualmann 2019-06-28 19:42:12 UTC
Ok, I close the bug, if necessary open again.

Maik