PacketFence - BTS - PacketFence
View Issue Details
0000863PacketFencepublic2009-11-30 15:052011-01-26 15:39
obilodeau 
rbalzard 
highminorhave not tried
closedfixed 
 
1.9.0 
df864b7289b1596a82abbfba30b3eee2688944b7
0000863: web admin's node tab is slow when there are a lot of nodes
my guess is that each node does a subselect and that's why its so long.

$node_view_all_sql
        = "select node.mac,node.pid,node.detect_date,node.regdate,node.unregdate,node.lastskip,node.status,node.user_agent,node.computername,node.notes,node.last_arp,node.last_dhcp,node.dhcp_fingerprint,node.switch,node.port,node.vlan,ifnull(openviolations.nb,0) as nbopenviolations from node left join (select violation.mac,count(*) as nb from violation where status='open' group by violation.mac) as openviolations on node.mac=openviolations.mac";

the idea here is, should we limit the query to what we can see on the screen or should we optimize it?
No tags attached.
Issue History
2009-11-30 15:05obilodeauNew Issue
2009-11-30 15:05obilodeauStatusnew => assigned
2009-11-30 15:05obilodeauAssigned To => obilodeau
2010-03-15 17:11obilodeaumtn revision => df864b7289b1596a82abbfba30b3eee2688944b7
2010-03-15 17:11obilodeauNote Added: 0001496
2010-03-15 17:11obilodeauAssigned Toobilodeau => rbalzard
2010-03-15 17:11obilodeauStatusassigned => resolved
2010-03-15 17:11obilodeauResolutionopen => fixed
2010-03-15 17:11obilodeauFixed in Version => 1.8.8
2010-04-29 13:38obilodeauFixed in Version1.8.8 => 1.9.0
2011-01-26 15:39obilodeauStatusresolved => closed

Notes
(0001496)
obilodeau   
2010-03-15 17:11   
Fixed by Regis in branch 1.8.

The problem was not missing limit clauses, they are appended automatically. The problem was in the subselect. Regis found a way to avoid subselect with grouping and using having instead of where clauses.