mirror of
https://github.com/phpbb/phpbb.git
synced 2025-04-21 08:12:17 +02:00
[ticket/11188] Reduce waste.
PHPBB3-11188
This commit is contained in:
parent
763f2929ba
commit
3d27ed13f5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user