J3 Issue ?
avatar BrainforgeUK
BrainforgeUK
11 Aug 2018

Steps to reproduce the issue

System with large number of guest sessions very slow.
Also query does not use ORDER BY so no guarantee last X logged in users will be shown.

Expected result

Actual result

System information (as much as possible)

Joomla 3.8.10
MySQL 5.5.52

Additional comments

Suggest changing WHERE clause in getList() method in ModLoggedHelper to
$query = $db->getQuery(true)
->select('s.time, s.client_id, u.id, u.name, u.username')
->from('#__session AS s')
->join('LEFT', '#__users AS u ON s.userid = u.id')
->where('s.userid > 0') // Added, uses existing index
->where('s.guest = 0')
->order('s.time DESC'); // Added, guarantees last X rows returned

avatar BrainforgeUK BrainforgeUK - open - 11 Aug 2018
avatar joomla-cms-bot joomla-cms-bot - change - 11 Aug 2018
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Aug 2018
avatar franz-wohlkoenig franz-wohlkoenig - change - 11 Aug 2018
Category com_admin
avatar BrainforgeUK
BrainforgeUK - comment - 11 Aug 2018

This issue also affects mod_status.
Need to add userid > 0 clause to all guest = 0 conditions

Putting an index on the 'guest' column will resolve this issue in both cases.
Could this be a better method that changing the code?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/21555.

avatar Quy
Quy - comment - 11 Aug 2018

Maybe PR #19708 will help too.

avatar franz-wohlkoenig franz-wohlkoenig - change - 12 Aug 2018
Status New Discussion
avatar SharkyKZ
SharkyKZ - comment - 13 Aug 2018

Remove WHERE clause and replace LEFT JOIN with INNER JOIN.

avatar brianteeman brianteeman - change - 30 Oct 2018
Labels Added: J3 Issue
avatar brianteeman brianteeman - labeled - 30 Oct 2018
avatar alikon
alikon - comment - 10 Apr 2019

@franz-wohlkoenig can be closed as we have a pr #23650

avatar franz-wohlkoenig franz-wohlkoenig - change - 10 Apr 2019
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2019-04-10 12:21:01
Closed_By franz-wohlkoenig
avatar franz-wohlkoenig franz-wohlkoenig - close - 10 Apr 2019

Add a Comment

Login with GitHub to post a comment