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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user