mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00: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:
parent
03d50a2e83
commit
823f2571f5
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue