mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-03-28 17:42:57 +01:00
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:
@@ -301,7 +301,7 @@ $page['nb_orphans'] = 0;
|
||||
list($page['nb_photos_total']) = pwg_db_fetch_row(pwg_query('SELECT COUNT(*) FROM '.IMAGES_TABLE));
|
||||
if ($page['nb_photos_total'] < 100000) // 100k is already a big gallery
|
||||
{
|
||||
$page['nb_orphans'] = count(get_orphans());
|
||||
$page['nb_orphans'] = count_orphans();
|
||||
}
|
||||
|
||||
$template->assign(
|
||||
|
||||
Reference in New Issue
Block a user