mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
[ticket/9536] Small improvement for query against user/session tables when managing users from the ACP.
There can be multiple entries in the session table for one user_id. We only need and also only fetch one. Using LIMIT 1 should therefore increase performance slightly. This is especially true when editing the anonymous user account because the session table can have many entries for the user_id ANONYMOUS. PHPBB3-9536
This commit is contained in:
committed by
Nils Adermann
parent
03d50a2e83
commit
823f2571f5
@@ -105,7 +105,7 @@ class acp_users
|
||||
LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
|
||||
WHERE u.user_id = ' . $user_id . '
|
||||
ORDER BY s.session_time DESC';
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$user_row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
@@ -2084,7 +2084,7 @@ class acp_users
|
||||
LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
|
||||
WHERE u.user_id = ' . $user_id . '
|
||||
ORDER BY s.session_time DESC';
|
||||
$result = $db->sql_query($sql);
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$user_row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
Reference in New Issue
Block a user