fixes #1830 faster way to calculate number of orphans

* store count result in config table, as a cache
* resets this cache on invalidate_user_cache
* instead of a costly SQL query with a LEFT JOIN, use 2 simple COUNT in the 2 tables, and compare
This commit is contained in:
plegall
2023-10-06 15:03:22 +02:00
parent d050573d83
commit 09890487cd
3 changed files with 30 additions and 2 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ $nb_orphans = $page['nb_orphans']; // already calculated in admin.php
if ($page['nb_photos_total'] >= 100000) // but has not been calculated on a big gallery, so force it now
{
$nb_orphans = count(get_orphans());
$nb_orphans = count_orphans();
}
if ($nb_orphans > 0)