From 785c75254e763a24cf56765ca9a7e02140982497 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:29:28 +0100 Subject: [PATCH] [ticket/9813] Also use estimated row count of posts table for fulltext mysql. Since this is 'only' for statistics anyway, using an estimated value does no harm. Also, if MyISAM is the underlying storage engine for the posts table, the value will actually be exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 52372a14d8..54cc894f6a 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,11 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $sql = 'SELECT COUNT(post_id) as total_posts - FROM ' . POSTS_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts'); - $db->sql_freeresult($result); + $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); } /**