optimized non-german logs list

This commit is contained in:
following
2013-04-10 22:43:06 +02:00
parent 7d45d83325
commit 2178693c26

View File

@ -11,21 +11,27 @@
$tpl->name = 'newlogsrest';
$tpl->menuitem = MNU_START_NEWLOGSREST;
$exclude_country = 'DE';
// As nearly all logs are from Germany, retrieving non-German logs is
// expensive -> longer cache lifetime and smaller count:
$tpl->cache_lifetime = 900;
$logcount = 150;
}
else
{
$tpl->name = 'newlogs';
$tpl->menuitem = MNU_START_NEWLOGS;
$exclude_country = '*';
$tpl->cache_lifetime = 300;
$logcount = 250;
}
$tpl->caching = true;
$tpl->cache_lifetime = 300;
if (!$tpl->is_cached())
{
sql_temp_table_slave('loglist');
sql_slave("CREATE TEMPORARY TABLE &loglist (`id` INT(11) PRIMARY KEY) SELECT `cache_logs`.`id` FROM `cache_logs` INNER JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` WHERE `cache_status`.`allow_user_view`=1 AND `caches`.`country`<>'&1' ORDER BY `cache_logs`.`date_created` DESC LIMIT 200", $exclude_country);
sql_slave("CREATE TEMPORARY TABLE &loglist (`id` INT(11) PRIMARY KEY) SELECT `cache_logs`.`id` FROM `cache_logs` INNER JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` WHERE `cache_status`.`allow_user_view`=1 AND `caches`.`country`<>'&1' ORDER BY `cache_logs`.`date_created` DESC LIMIT &2", $exclude_country, $logcount);
if ($opt['logic']['new_logs_per_country'])
$sqlOrderBy = '`countries`.`de` ASC, ';