I'm doing a simple query in LMS Moodle to get the amount of access from all users.
SELECT
count(userid) as total,
action,
userid
FROM
mdl_logstore_standard_log log
WHERE
action = 'loggedin'
GROUP BY
userid
The table involved has more than 500 thousand lines and the trend is only to increase.
I ran it 4, 5 minutes ago and still did not show the results.
Is there a way to do some optimization?
My knowledge is limited in Database Performance.