Bug #2068
closedSome queries are overly slow
Description
On the (small) test machine, some queries take a lot of time :
When displaying a node
2011-11-22 14:20:50 CET rudder rudder LOG: exécute <unnamed>: select executiondate, nodeid, configurationruleid, policyinstanceid, serial, component, keyValue, executionTimeStamp, eventtype, policy, msg from RudderSysEvents join (select
nodeid as Node, max(executiontimestamp) as Time from ruddersysevents where configurationRuleId = 'hasPolicyServer-root' and component = 'common' and keyValue = 'EndRun' group by nodeid ) as Ordering on Ordering.Node = nodeid and execution
TimeStamp = Ordering.Time where 1=1 and configurationRuleId = $1 and serial = $2 and executionTimeStamp > (now() - interval '15 minutes') and nodeId = $3
2011-11-22 14:20:50 CET rudder rudder DÉTAIL: paramètres : $1 = 'hasPolicyServer-root', $2 = '35', $3 = '06da3556-5204-4bd7-b3b0-fa5e7bcfbbea'
2011-11-22 14:20:56 CET rudder rudder LOG: durée : 5701.757 ms
2011-11-22 14:23:54 CET rudder rudder LOG: instruction : select executiondate, nodeid, configurationruleid, policyinstanceid, serial, component, keyValue, executionTimeStamp, eventtype, policy, msg from RudderSysEvents join (select nodei
d as Node, max(executiontimestamp) as Time from ruddersysevents where configurationRuleId = 'hasPolicyServer-root' and component = 'common' and keyValue = 'EndRun' group by nodeid ) as Ordering on Ordering.Node = nodeid and executionTimeS
tamp = Ordering.Time where 1=1 and configurationRuleId = 'hasPolicyServer-root' and serial = '35' and nodeId = '06da3556-5204-4bd7-b3b0-fa5e7bcfbbea';
2011-11-22 14:24:07 CET rudder rudder LOG: durée : 13198.511 ms
A view would be great, or at least an optimisation on the inner query
Updated by Jonathan CLARKE about 13 years ago
- Target version changed from 2.4.0~alpha1 to 2.4.0~alpha2
Updated by Nicolas CHARLES almost 13 years ago
Use this document as a reference to help
www.pgexperts.com/document.html?id=36
Updated by Jonathan CLARKE almost 13 years ago
- Target version changed from 2.4.0~alpha2 to 2.4.0~alpha3
Updated by François ARMAND almost 13 years ago
- Target version changed from 2.4.0~alpha3 to 24
Updated by Jonathan CLARKE over 12 years ago
- Status changed from New to In progress
- Target version changed from 24 to 2.4.0~alpha7
Updated by Jonathan CLARKE over 12 years ago
Nicolas, your last commit (for the rudder-upgrade script) looks good, but you also need to tell the packaging to include your new migration file. See https://github.com/Normation/rudder-packages/blob/master/rudder-webapp/SPECS/rudder-webapp.spec#L152 and https://github.com/Normation/rudder-packages/blob/master/rudder-webapp/debian/rules#L79 (yes, it must be done in both).
Updated by Jonathan CLARKE over 12 years ago
On another subject, your commit e02a4995fc44c4d1a8cfbbbe621a12ad327eec0b is attached to this request but has been applied to the 2.3 branch. As this issue is targeted to 2.4, I think it should be reverted also.
Updated by Jonathan CLARKE over 12 years ago
- Status changed from In progress to Pending technical review
- Assignee changed from Nicolas CHARLES to François ARMAND
The packaging side of this looks good to me now.
François, can you review the other commits?
Updated by François ARMAND over 12 years ago
- Status changed from Pending technical review to Released
That seems OK, even if I don't fully understand it all. I didn't see anything obviously wrong :)