Bug 514970 - Create index on ImageTagProperties.property
Summary: Create index on ImageTagProperties.property
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Database-Models (other bugs)
Version First Reported In: 8.8.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-23 11:27 UTC by Terényi, Balázs
Modified: 2026-04-25 16:34 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Terényi, Balázs 2026-01-23 11:27:49 UTC
SUMMARY
Face confirmation is slow on my setup, so I checked what can I do to make it faster. I enabled mysql slow query log, and one query was always over 1s. So I added an index on ImageTagProperties.property column, which made the UI experience much better.

STEPS TO REPRODUCE
1. Work on People tab: tag assigment/confirmation is slow
2. Create the index in the database
3. The UI is much more responsive, tagging is noticeably faster. Didn't experienced any slowdown because of the new index in other workflows of Digikam.

OBSERVED RESULT
Tag confirmation/assignment on the People tab is slow.

EXPECTED RESULT
Tag confirmation/assignment on the People tab is faster.

SOFTWARE/OS VERSIONS
My digikam database engine is mysql on a NAS on gigabit LAN.

ADDITIONAL INFORMATION
MariaDB [digikam]> SELECT tagid, COUNT(*) FROM ImageTagProperties LEFT JOIN Images ON Images.id=ImageTagProperties.imageid  WHERE ImageTagProperties.property='autodetectedFace' AND Images.status=1 GROUP BY tagid;
+-------+----------+
| tagid | COUNT(*) |
+-------+----------+
|     1 |     6652 |
...
|   154 |       87 |
+-------+----------+
20 rows in set (1.34 sec)

MariaDB [digikam]> create index imagetagproperties_property on ImageTagProperties (property(24));
Query OK, 0 rows affected (1.44 sec)
Records: 0  Duplicates: 0  Warnings: 0

MariaDB [digikam]> SELECT tagid, COUNT(*) FROM ImageTagProperties LEFT JOIN Images ON Images.id=ImageTagProperties.imageid  WHERE ImageTagProperties.property='autodetectedFace' AND Images.status=1 GROUP BY tagid;
+-------+----------+
| tagid | COUNT(*) |
+-------+----------+
|     1 |     6652 |
...
|   154 |       87 |
+-------+----------+
20 rows in set (0.92 sec)
Comment 1 Maik Qualmann 2026-04-19 04:45:25 UTC
*** Bug 519125 has been marked as a duplicate of this bug. ***
Comment 2 Maik Qualmann 2026-04-19 06:41:21 UTC
Git commit ad5bb7d1da29dc6d90e4961d53afe79bbfa429b3 by Maik Qualmann.
Committed on 19/04/2026 at 06:40.
Pushed by mqualmann into branch 'master'.

prepare database update to add ImageTagProperties index and a timezone field
Related: bug 519125, bug 517889, bug 510261, bug 495506, bug 491608, bug 485836, bug 251357

M  +46   -1    core/data/database/dbconfig.xml.cmake.in
M  +8    -0    core/libs/database/coredb/coredbschemaupdater.cpp

https://invent.kde.org/graphics/digikam/-/commit/ad5bb7d1da29dc6d90e4961d53afe79bbfa429b3
Comment 3 Maik Qualmann 2026-04-25 14:41:12 UTC
Git commit 603698d3e1659a553fc4b79cc84c5b29f8fcbca7 by Maik Qualmann.
Committed on 25/04/2026 at 14:38.
Pushed by mqualmann into branch 'master'.

prepare database update to add Indexes and timezone field
Related: bug 519125, bug 519389, bug 519390

M  +45   -13   core/data/database/dbconfig.xml.cmake.in

https://invent.kde.org/graphics/digikam/-/commit/603698d3e1659a553fc4b79cc84c5b29f8fcbca7
Comment 4 Maik Qualmann 2026-04-25 16:34:01 UTC
Git commit 3b256067d8938838522c16ab7df05fe5c03f21c2 by Maik Qualmann.
Committed on 25/04/2026 at 16:33.
Pushed by mqualmann into branch 'master'.

database update to add Indexes and timezone field to V17
Related: bug 519125, bug 519389, bug 519390
FIXED-IN: 9.1.0

M  +4    -4    NEWS
M  +8    -9    core/data/database/dbconfig.xml.cmake.in
M  +1    -1    core/libs/database/coredb/coredbschemaupdater.cpp

https://invent.kde.org/graphics/digikam/-/commit/3b256067d8938838522c16ab7df05fe5c03f21c2