Skip to content

Commit

Permalink
Added job fetch index
Browse files Browse the repository at this point in the history
  • Loading branch information
timgit committed May 9, 2017
1 parent 2bf9ce3 commit e059075
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plans.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function create(schema) {
createVersionTable(schema),
createJobStateEnum(schema),
createJobTable(schema),
createIndexJobFetch(schema),
createIndexSingletonOn(schema),
createIndexSingletonKeyOn(schema),
createIndexSingletonKey(schema)
Expand Down Expand Up @@ -116,6 +117,12 @@ function createIndexSingletonKeyOn(schema){
`;
}

function createIndexJobFetch(schema){
return `
CREATE INDEX job_fetch ON ${schema}.job (priority desc, createdOn, id) WHERE state < '${states.active}'
`;
}

function getVersion(schema) {
return `
SELECT version from ${schema}.version
Expand Down

0 comments on commit e059075

Please sign in to comment.