Skip to content
Permalink
Browse files

optimized new logs list (for MariaDB)

  • Loading branch information...
following5 committed Dec 8, 2015
1 parent 35f07d3 commit 9e2ef8970f1bc6c6ef85aca61609b06c5f252ee3
Showing with 4 additions and 4 deletions.
  1. +4 −4 htdocs/newlogs.php
@@ -11,7 +11,7 @@
$newLogsPerCountry = $opt['logic']['new_logs_per_country'];
$startat = isset($_GET['startat']) ? $_GET['startat']+0 : 0;
$urlparams = '';
$optimize_for_main_country = false;
$optimize_for_latest_logs = false;
if (isset($ownerid))
{
@@ -81,7 +81,7 @@
$logcount = 250;
$paging = false; // paging would have poor performance for all logs
$orderByDate = '';
$optimize_for_main_country = ($country == $opt['page']['main_country']);
$optimize_for_latest_logs = ($country == '' || $country == $opt['page']['main_country']);
}
$tpl->change_country_inpage = true;
@@ -90,7 +90,7 @@
if (!$tpl->is_cached())
{
if ($paging) sql_enable_foundrows();
if ($optimize_for_main_country)
if ($optimize_for_latest_logs)
{
// filtering a large number of logs is very expensive;
// therefore we preselect the newest logs if the main country is selected
@@ -226,7 +226,7 @@
sql_free_result($rsLogs);
sql_drop_temp_table_slave('loglist');
if ($optimize_for_main_country)
if ($optimize_for_latest_logs)
sql_drop_temp_table_slave('loglist0');
$tpl->assign('newLogs', $newLogs);

0 comments on commit 9e2ef89

Please sign in to comment.
You can’t perform that action at this time.