From cdd60722550e4c3fc22faf1d00b0214f0d08bce8 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 5 Apr 2007 17:48:22 +0200 Subject: [PATCH] Optomalize! --- web/nettkart-telnet.pl | 5 +---- web/nettkart-text.pl | 5 +---- web/nettkart-web.pl | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/web/nettkart-telnet.pl b/web/nettkart-telnet.pl index b3ea2df..2a21bad 100755 --- a/web/nettkart-telnet.pl +++ b/web/nettkart-telnet.pl @@ -17,10 +17,7 @@ print <<"EOF"; EOF -my $q = $dbh->prepare('select * from switches natural join placements natural left join -( select switch,sum(bytes_in)/count(*) as -bytes_in,sum(bytes_out)/count(*) as bytes_out from get_datarate() group -by switch ) t1'); +my $q = $dbh->prepare('select * from switches natural join placements'); $q->execute(); while (my $ref = $q->fetchrow_hashref()) { $ref->{'placement'} =~ /\((\d+),(\d+)\),\((\d+),(\d+)\)/; diff --git a/web/nettkart-text.pl b/web/nettkart-text.pl index 9e2eb32..23e5cad 100755 --- a/web/nettkart-text.pl +++ b/web/nettkart-text.pl @@ -17,10 +17,7 @@ print <<"EOF"; EOF -my $q = $dbh->prepare('select * from switches natural join placements natural left join -( select switch,sum(bytes_in)/count(*) as -bytes_in,sum(bytes_out)/count(*) as bytes_out from get_datarate() group -by switch ) t1'); +my $q = $dbh->prepare('select * from switches natural join placements'); $q->execute(); while (my $ref = $q->fetchrow_hashref()) { $ref->{'placement'} =~ /\((\d+),(\d+)\),\((\d+),(\d+)\)/; diff --git a/web/nettkart-web.pl b/web/nettkart-web.pl index a3d64ac..8f37b1e 100755 --- a/web/nettkart-web.pl +++ b/web/nettkart-web.pl @@ -17,10 +17,7 @@ print <<"EOF"; EOF -my $q = $dbh->prepare('select * from switches natural join placements natural left join -( select switch,sum(bytes_in)/count(*) as -bytes_in,sum(bytes_out)/count(*) as bytes_out from get_datarate() group -by switch ) t1'); +my $q = $dbh->prepare('select * from switches natural join placements'); $q->execute(); while (my $ref = $q->fetchrow_hashref()) { $ref->{'placement'} =~ /\((\d+),(\d+)\),\((\d+),(\d+)\)/; -- 2.39.2