This query is going to turn into two variants, one of which doesn't have the url join.
In the output, prefer to refer to fields from job. They are constrained to be equal (and they are not null) so this has no functional change. Also swap the conditions over for clarity. No functional change. Signed-off-by: Ian Jackson <ian.jack...@eu.citrix.com> --- cs-bisection-step | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cs-bisection-step b/cs-bisection-step index 16227234..f9ef1558 100755 --- a/cs-bisection-step +++ b/cs-bisection-step @@ -231,8 +231,8 @@ END SELECT url.val AS uval, rev.val AS rval, - url.job AS job, - ${\ other_revision_job_suffix('url.job','url.use',' ') } AS othrev, + rev.job AS job, + ${\ other_revision_job_suffix('rev.job','rev.use',' ') } AS othrev, url.name AS longname FROM tmp_build_info AS rev @@ -241,8 +241,8 @@ END WHERE (rev.name LIKE E'built\\_revision\\_%' OR rev.name LIKE E'revision\\_%') AND url.name LIKE E'tree\\_%' - AND rev.use = url.use - AND rev.job = url.job + AND url.use = rev.use + AND url.job = rev.job AND (rev.name = 'built_revision_' || substr(url.name,6) OR rev.name = 'revision_' || substr(url.name,6)) -- 2.20.1