1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/13713] Cache SQL queries

PHPBB3-13713
This commit is contained in:
lavigor
2018-07-11 02:56:31 +03:00
committed by Marc Alexander
parent b5ce3343ed
commit 0aadd52014
9 changed files with 58 additions and 32 deletions

View File

@@ -20,13 +20,14 @@ class user extends base_user
*/
protected function query($keyword, $topic_id)
{
// TODO: think about caching ALL users: 1m users results to ~40MB file
$query = $this->db->sql_build_query('SELECT', [
'SELECT' => 'u.username, u.user_id',
'SELECT' => 'u.username_clean, u.username, u.user_id',
'FROM' => [
USERS_TABLE => 'u',
],
'WHERE' => $this->db->sql_in_set('u.user_type', [USER_NORMAL, USER_FOUNDER]) . '
AND u.username_clean ' . $this->db->sql_like_expression($keyword . $this->db->get_any_char()),
'WHERE' => $this->db->sql_in_set('u.user_type', [USER_NORMAL, USER_FOUNDER])/* . '
AND u.username_clean ' . $this->db->sql_like_expression($keyword . $this->db->get_any_char())*/,
'ORDER_BY' => 'u.user_lastvisit DESC'
]);
return $query;