Actions
Feature #186
closedUI Slows down when reports are not purged form DB.
Description
If you don't purged the reports from your database the lookup queries for the last report of a hosts start slowing down due to the way ActiveRecord queries for it:
Host.reports.last will generate the following SQL statement:
Report Load (1611.5ms) SELECT * FROM `reports` WHERE (`reports`.host_id = 19) ORDER BY reports.id DESC LIMIT 1
By changing that query to Host.find(host.id).reports.maximum('id')) we make a more efficient query improving the response.
Report Load (3.2ms) SELECT * FROM `reports` WHERE (`reports`.`id` = 85955)
Patch attached
Files
Updated by Telmo X almost 15 years ago
- Status changed from New to Ready For Testing
Applied in changeset bc4f02848eb32c21f72495b421fdb3335a9e45ef.
Updated by Ohad Levy almost 15 years ago
- Status changed from Ready For Testing to Closed
Actions