diff mbox series

[OSSTEST,v2,37/41] cs-bisection-step: temporary table: Insert only rows we care about

Message ID 20200731113820.5765-38-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Performance work | expand

Commit Message

Ian Jackson July 31, 2020, 11:38 a.m. UTC
Every use of this table has a WHERE or ON which invokes at least one
of these conditions.  So put only those rows into the table.

This provides a significant speedup (which I haven't properly
measured).

No overall functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v2: New patch.
---
 cs-bisection-step | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/cs-bisection-step b/cs-bisection-step
index 1c165b78..718c87b0 100755
--- a/cs-bisection-step
+++ b/cs-bisection-step
@@ -219,7 +219,9 @@  END
     
            WHERE t.job = ?
 	     AND t.flight = ?
-	     AND t.name LIKE '%buildjob'
+	     AND t.name LIKE '%buildjob' AND
+(@{ $qtxt_common_rev_ok->('b') } OR
+ @{ $qtxt_common_tree_ok->('b') })
 	     AND b.flight = (CASE WHEN t.val NOT LIKE '%.%'
                                   THEN t.flight
                                   ELSE cast(split_part(t.val, '.', 1) AS int)
@@ -239,7 +241,9 @@  END
 	           job  AS job
 	      FROM runvars
 	     WHERE job = ?
-	       AND flight = ?
+	       AND flight = ? AND
+(@{ $qtxt_common_rev_ok->('runvars') } OR
+ @{ $qtxt_common_tree_ok->('runvars') })
 END
 
     my $qtxt_common_results = <<END;