* 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

@ -434,12 +434,13 @@ create index IndexBuildStepsOnOutpath on BuildSteps(outpath);
create index IndexBuildStepsOnOutpathBuild on BuildSteps (outpath, build);
create index IndexBuildsOnFinished on Builds(finished);
create index IndexBuildsOnIsCurrent on Builds(isCurrent);
create index IndexBuildsOnJob on Builds(project, jobset, job);
create index IndexBuildsOnJobAndIsCurrent on Builds(project, jobset, job, isCurrent);
#create index IndexBuildsOnJob on Builds(project, jobset, job);
#create index IndexBuildsOnJobAndIsCurrent on Builds(project, jobset, job, isCurrent);
create index IndexBuildsOnJobAndSystem on Builds(project, jobset, job, system);
create index IndexBuildsOnJobset on Builds(project, jobset);
create index IndexBuildsOnProject on Builds(project);
create index IndexBuildsOnTimestamp on Builds(timestamp);
create index IndexBuildsOnJobFinishedId on builds(project, jobset, job, system, finished, id DESC);
create index IndexCachedGitInputsOnHash on CachedGitInputs(uri, branch, sha256hash);
create index IndexCachedGitInputsOnLastSeen on CachedGitInputs(uri, branch, lastSeen);
create index IndexCachedSubversionInputsOnUriRevision on CachedSubversionInputs(uri, revision);