From 469219162f0a3cb51f53bd1b4172c3b424be1ec0 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 18 May 2007 05:16:33 +0100 Subject: increase performance of queryFeedHeadlines request --- functions.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index ba8c4e6a6..ec234ddc2 100644 --- a/functions.php +++ b/functions.php @@ -2532,7 +2532,7 @@ $query = "SELECT guid, ttrss_entries.id,ttrss_entries.title, - SUBSTRING(updated,1,16) as updated, + updated, unread,feed_id,marked,link,last_read, SUBSTRING(last_read,1,19) as last_read_noms, $vfeed_query_part @@ -2563,7 +2563,7 @@ $result = db_query($link, "SELECT guid, ttrss_entries.id as id,title, - SUBSTRING(updated,1,16) as updated, + updated, unread,feed_id, marked,link,last_read, SUBSTRING(last_read,1,19) as last_read_noms, @@ -3564,6 +3564,8 @@ function outputHeadlinesList($link, $feed, $subop, $view_mode, $limit, $cat_view, $next_unread_feed, $offset) { + $timing_info = getmicrotime(); + $topmost_article_ids = array(); if (!$offset) $offset = 0; @@ -3636,9 +3638,13 @@ $real_offset = $offset * $limit; + if ($_GET["debug"]) $timing_info = print_checkpoint("H0", $timing_info); + $qfh_ret = queryFeedHeadlines($link, $feed, $limit, $view_mode, $cat_view, $search, $search_mode, $match_on, false, $real_offset); + if ($_GET["debug"]) $timing_info = print_checkpoint("H1", $timing_info); + $result = $qfh_ret[0]; $feed_title = $qfh_ret[1]; $feed_site_url = $qfh_ret[2]; @@ -3723,10 +3729,10 @@ # $line["title"] . ""; if (get_pref($link, 'HEADLINES_SMART_DATE')) { - $updated_fmt = smart_date_time(strtotime($line["updated"])); + $updated_fmt = smart_date_time(strtotime($line["updated_noms"])); } else { $short_date = get_pref($link, 'SHORT_DATE_FORMAT'); - $updated_fmt = date($short_date, strtotime($line["updated"])); + $updated_fmt = date($short_date, strtotime($line["updated_noms"])); } if (get_pref($link, 'SHOW_CONTENT_PREVIEW')) { @@ -3928,4 +3934,10 @@ $key . '">' . $key . ' '; } } + + function print_checkpoint($n, $s) { + $ts = getmicrotime(); + echo sprintf("", $ts - $s); + return $ts; + } ?> -- cgit v1.2.3