When searching a path / drv path, use separate queries for both options to prevent seq. scan.

This commit is contained in:
Rob Vermaas
2013-04-26 08:51:49 -04:00
parent 591aee0793
commit fd7acd9bbf
2 changed files with 25 additions and 9 deletions

View File

@ -1,6 +1,21 @@
[% WRAPPER layout.tt title="Search results" %]
[% PROCESS common.tt %]
[% matched = 0 %]
[% BLOCK renderBuildSearch %]
[% IF builds.size > 0 %]
<p>The following builds match your query:[% IF builds.size > limit %] <span class="text-warning">(first [% limit %] results only)</span>[% END %]</p>
[% INCLUDE renderBuildList %]
[% END %]
[% END; %]
[% IF projects.size > 0; matched = 1 %]
<p>The following projects match your query:</p>
@ -60,17 +75,13 @@
[% END %]
[% IF builds.size > 0; matched = 1 %]
[% INCLUDE renderBuildSearch %]
[% INCLUDE renderBuildSearch builds=buildsdrv %]
<p>The following builds match your query:[% IF jobs.size > limit %] <span class="text-warning">(first [% limit %] results only)</span>[% END %]</p>
[% INCLUDE renderBuildList %]
[% END %]
[% IF builds.size > 0 || buildsdrv.size > 0 ; matched = 1 ; END %]
[% IF !matched %]
<div class="alert alert-warn">Sorry! Nothing matches your
query.</div>
<div class="alert alert-warn">Sorry! Nothing matches your query.</div>
[% END %]
[% END %]