diff options
author | Andreas Fischer <bantu@phpbb.com> | 2010-04-12 21:08:55 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2010-05-14 02:31:44 +0200 |
commit | 823f2571f5443e3529327047f0d50d0955a4be45 (patch) | |
tree | 1601d91cb3d2b597ac3b9ffc02ea12278674388b /phpBB/includes | |
parent | 03d50a2e83cc631779a7574acd4db8b77f29d547 (diff) | |
download | forums-823f2571f5443e3529327047f0d50d0955a4be45.tar forums-823f2571f5443e3529327047f0d50d0955a4be45.tar.gz forums-823f2571f5443e3529327047f0d50d0955a4be45.tar.bz2 forums-823f2571f5443e3529327047f0d50d0955a4be45.tar.xz forums-823f2571f5443e3529327047f0d50d0955a4be45.zip |
[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
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4905840e02..98409c7c0b 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -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); } |