* Make the "latest succeeded" query (used by the "latest" channel)

faster, from about 4.5s to 1.0s for the global "latest" channel.
  Note that the query is only fast if the "IndexBuildsOnJob" and
  "IndexBuildsOnJobAndIsCurrent" indices are dropped - if they exist,
  PostgreSQL will use those instead of the more efficient
  "IndexBuildsOnJobFinishedId" index.  Looks like a bug in the planner
  to me...
This commit is contained in:
Eelco Dolstra
2010-02-12 14:49:32 +00:00
parent 9cebf03a45
commit d8cc0bbb5d
3 changed files with 13 additions and 9 deletions

View File

@ -65,7 +65,7 @@ sub getChannelData {
my ($c, $builds) = @_;
my @builds2 = joinWithResultInfo($c, $builds)
->search_literal("exists (select 1 from buildproducts where build = me.id and type = 'nix-build')");
->search_literal("exists (select 1 from buildproducts where build = resultInfo.id and type = 'nix-build')");
my @storePaths = ();
foreach my $build (@builds2) {