Eliminate one db call in IP subnet utilization report. Limit clause is not applied until after all rows to be returned are calculated so calling has_rows provides no optimization versus calling ->all in controller and checking for results before sending to template. Also use HashRefInflator.

This commit is contained in:
Eric A. Miller
2014-06-07 14:52:26 -04:00
parent 2e6deba1a6
commit c8b05263e6
3 changed files with 8 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
[% USE CSV %]
[% CSV.dump([ 'Subnet' 'Size' 'Number of Active Nodes' 'Percent Utilization' ]) %]
[% FOREACH row IN results.all %]
[% FOREACH row IN results %]
[% mylist = [] %]
[% mylist.push(row.subnet) %]
[% mylist.push(row.subnet_size) %]