No Code Attached Yet bug
avatar c-schmitz
c-schmitz
30 Apr 2024

Steps to reproduce the issue

We have about 2 million action log entries and roughly 400k users.
When trying to view the action log then the every page/action in the action log viewer takes >20 seconds to load.

Expected result

As there are only 20 entries visible in the action log grid I would expect it to be quick to show.

Actual result

Take 20-30 secons to show the default screen

System information (as much as possible)

I noticed whenever I try to do any action in the action log viewer the following query is executed:

SELECT u.id AS value,u.username AS text
FROM jos_users AS u
INNER JOIN jos_action_logs AS c ON c.user_id = u.id
GROUP BY u.id,u.username
ORDER BY u.username

Not sure why this generalized query is run at all.

Additional comments

Query seems to originate from LogcreatorField->getOptions()
I think that is an extremly costly/inefficient query and it is only used to populate the user field in the filter - instead that field should be a plain text search field.

avatar c-schmitz c-schmitz - open - 30 Apr 2024
avatar joomla-cms-bot joomla-cms-bot - change - 30 Apr 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Apr 2024
avatar c-schmitz c-schmitz - change - 30 Apr 2024
The description was changed
avatar c-schmitz c-schmitz - edited - 30 Apr 2024
avatar c-schmitz c-schmitz - change - 30 Apr 2024
The description was changed
avatar c-schmitz c-schmitz - edited - 30 Apr 2024
avatar c-schmitz c-schmitz - change - 30 Apr 2024
Title
Action log super slow when you have lots of users and actions
J4.4: Action log super slow when you have lots of users and actions
avatar c-schmitz c-schmitz - edited - 30 Apr 2024
avatar Hackwar Hackwar - change - 28 Nov 2024
Labels Added: bug
avatar Hackwar Hackwar - labeled - 28 Nov 2024
avatar Hackwar
Hackwar - comment - 28 Nov 2024

The problem is the filter at the top, which loads all users in one gigantic select list.

avatar c-schmitz
c-schmitz - comment - 28 Nov 2024

Yes, a classic 'Does it scale?' blunder ;)

avatar brianteeman
brianteeman - comment - 28 Nov 2024

Instead of it being a LogcreatorField it should be a type of user
Then you can still filter on a specific user without having to load all the users everytime

avatar brianteeman
brianteeman - comment - 28 Nov 2024

The downside of my suggested change is that the current list only includes users with an actionlog entry
The upside is obviously the speed

avatar brianteeman
brianteeman - comment - 28 Nov 2024

Please test #44550

avatar c-schmitz
c-schmitz - comment - 28 Nov 2024

I applied the change in Joomla 4 and it resolved the problem and worked as intended.

avatar alikon alikon - change - 28 Nov 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-11-28 11:54:44
Closed_By alikon
avatar alikon alikon - close - 28 Nov 2024
avatar alikon
alikon - comment - 28 Nov 2024

closing as we have a pr #44550

avatar brianteeman
brianteeman - comment - 28 Nov 2024

@c-schmitz Please go to the issue tracker here https://issues.joomla.org/tracker/joomla-cms/44550 and mark your test result by using the blue "Test this" button at the top left corner, selecting your test result and finally submit, so that your test is properly counted. Just a comment here is not enough. Thanks in advance.

Add a Comment

Login with GitHub to post a comment