aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search/fulltext_postgres.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2012-12-29 19:34:21 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2012-12-30 18:50:09 -0500
commit3d27ed13f5ac960fc24a3f95e39c767be4a48f31 (patch)
treee7f5f2e9f1b5625d7bd0bd08528cebb7341bdff2 /phpBB/includes/search/fulltext_postgres.php
parent763f2929babcb65b503a60f712bfc552f1e296f9 (diff)
downloadforums-3d27ed13f5ac960fc24a3f95e39c767be4a48f31.tar
forums-3d27ed13f5ac960fc24a3f95e39c767be4a48f31.tar.gz
forums-3d27ed13f5ac960fc24a3f95e39c767be4a48f31.tar.bz2
forums-3d27ed13f5ac960fc24a3f95e39c767be4a48f31.tar.xz
forums-3d27ed13f5ac960fc24a3f95e39c767be4a48f31.zip
[ticket/11188] Reduce waste.
PHPBB3-11188
Diffstat (limited to 'phpBB/includes/search/fulltext_postgres.php')
-rw-r--r--phpBB/includes/search/fulltext_postgres.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
index 7d7b3f6fa8..1475cc31d0 100644
--- a/phpBB/includes/search/fulltext_postgres.php
+++ b/phpBB/includes/search/fulltext_postgres.php
@@ -477,10 +477,13 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
}
$this->db->sql_transaction('begin');
+
+ $sql_from = "FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p";
+ $sql_where = "WHERE (" . implode(' OR ', $tmp_sql_match) . ")
+ $sql_where_options";
$sql = "SELECT $sql_select
- FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
- WHERE (" . implode(' OR ', $tmp_sql_match) . ")
- $sql_where_options
+ $sql_from
+ $sql_where
ORDER BY $sql_sort";
$result = $this->db->sql_query_limit($sql, $this->config['search_block_size'], $start);
@@ -501,9 +504,8 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
if (!$result_count)
{
$sql_count = "SELECT COUNT(*) as result_count
- FROM $sql_from$sql_sort_table" . POSTS_TABLE . " p
- WHERE (" . implode(' OR ', $tmp_sql_match) . ")
- $sql_where_options";
+ $sql_from
+ $sql_where";
$result = $this->db->sql_query($sql_count);
$result_count = (int) $this->db->sql_fetchfield('result_count');
$this->db->sql_freeresult($result);