Slow listing of Smart Groups (fix included)

NTmatter
New Contributor II

Viewing Membership of Smart Groups has been rather sluggish on my JSS instance as of late, likely a result of not discovering the automatic log flushing functionality :)

Currently, clicking Management > Smart Computer Groups > (random small group) > View Membership results in a timeout. Digging through the mysql process list shows that queries are taking roughly a minute to complete. This may be the result of running on an officially unsupported configuration (Tomcat 7 / OpenJDK 7 / FreeBSD 9 Jail) but it seems unlikely in this case.

The following largely untested modification seems to cut the execution time down from a minute to near-instantaneous for a couple of views, including View Membership and Policy Execution History. Beware that this could do nasty things to your memory footprint or become a bottleneck if you have a write-heavy workload:

CREATE INDEX `computer_mtime` ON `usage_logs` (`computer_id`,`date_entered`);

To undo this modification, execute the following:

DROP INDEX `computer_mtime` ON `usage_logs`;

Hope this helps someone down the line!

0 REPLIES 0