[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 04/13] sg-report-host-history: Actually honour $minflight


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 8 Nov 2019 18:49:52 +0000
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@xxxxxxxxxxxxx; spf=Pass smtp.mailfrom=Ian.Jackson@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 08 Nov 2019 18:50:43 +0000
  • Ironport-sdr: AJRExs/14f51KprXrXfsw1FSOntMkl3TlPRA+dbgx5BhzuvFg58aMi/AwlLJtMm9WaJ7K+N/dG nYi5PjDO/J+oMHZkR5UBsDg/pEe7MSHH5TURT5V4PHuwhkWcci40XUzrzjaBixoWv+zzXrszp3 VeRt1zEe8Fl4SjtMcLwYXGCyrOq3GlQat6YKDnGIRqYyzHX8eCmuGies2juVA8mTYGasiAFdpx Mdb91exej2CTsi1Uba++EScgEEtkKVZj+vq4gsiYwY9YrYRKYH0/1gSJQqNnLgtUnBOPp7tgAe 0U0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This seriously speeds up some of the queries.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 sg-report-host-history | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sg-report-host-history b/sg-report-host-history
index fc51074d..d47784d9 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -67,6 +67,7 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
 
 our $restrictflight_cond = restrictflight_cond();
 our $flightcond;
+our $minflight;
 
 sub computeflightsrange () {
     if (!$flightlimit) {
@@ -100,7 +101,7 @@ END
          LIMIT 1
 END
     $minflightsq->execute();
-    my ($minflight) = $minflightsq->fetchrow_array();
+    ($minflight,) = $minflightsq->fetchrow_array();
     $minflight //= 0;
 
     $flightcond = "(flight > $minflight)";
@@ -127,10 +128,12 @@ sub mainquery () {
           AND ($valcond)
           AND $flightcond
            AND $restrictflight_cond
+           AND flight > ?
         ORDER BY flight DESC
         LIMIT ($limit * 3 + 100) * ?
 END
 
+    push @params, $minflight;
     push @params, scalar keys %hosts;
 
     print DEBUG "MAINQUERY...\n";
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.