diff options
| author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-08 08:44:24 -0500 |
|---|---|---|
| committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-03-08 08:44:24 -0500 |
| commit | d380a1a36ffd5b2de6e403eb63f8754d8a277386 (patch) | |
| tree | 167e903aad4f7408a131426112a065c19ade0b56 /phpBB/includes/search/fulltext_native.php | |
| parent | d67fae0f09b339dc0f399062dd228fba94e5aaa0 (diff) | |
| parent | c11607bdd1ad4209a7697f0dc8d46ea81795b14c (diff) | |
| download | forums-d380a1a36ffd5b2de6e403eb63f8754d8a277386.tar forums-d380a1a36ffd5b2de6e403eb63f8754d8a277386.tar.gz forums-d380a1a36ffd5b2de6e403eb63f8754d8a277386.tar.bz2 forums-d380a1a36ffd5b2de6e403eb63f8754d8a277386.tar.xz forums-d380a1a36ffd5b2de6e403eb63f8754d8a277386.zip | |
Merge remote-tracking branch 'bantu/ticket/9813' into develop-olympus
* bantu/ticket/9813:
[ticket/10653] Call get_row_count of base class in mysql get_estimated_row_count
[ticket/9813] Only get posts table row count if we detected a fulltext index.
[ticket/9813] Also use estimated row count of posts table for fulltext mysql.
[ticket/10653] Fix parameter to substr() in unit tests. Should be 1, not -1.
[ticket/10653] Unit tests for get_row_count() and get_estimated_row_count().
[ticket/10653] Add ability to count table rows to database abstraction layer.
[ticket/9813] Use table status row count only if greater than 100000 or exact.
[ticket/9813] Use SHOW TABLE STATUS to get search stats for native on MySQL.
Diffstat (limited to 'phpBB/includes/search/fulltext_native.php')
| -rw-r--r-- | phpBB/includes/search/fulltext_native.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index b63205fd76..dc961f3c8a 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1461,17 +1461,8 @@ class fulltext_native extends search_backend { global $db; - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); - - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); + $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); } /** |
