-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add templateId and archived index to jobs table #583
Add templateId and archived index to jobs table #583
Conversation
// eslint-disable-next-line no-unused-vars | ||
down: async (queryInterface, Sequelize) => { | ||
await queryInterface.sequelize.transaction(async transaction => { | ||
await queryInterface.removeIndex(table, `${table}_templateId_archived`, { transaction }); | ||
|
||
await queryInterface.addIndex(table, { | ||
name: `${table}_templateId`, | ||
fields: ['templateId'], | ||
transaction | ||
}); | ||
}); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkyi
I have confirmed locally that it works fine.
I have added it for easy rollback, but I am aware that it was not in the previous migration files.
If it is not needed, we will remove it. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not being absolutely necessary, I removed them according to customary practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see thanks for the context
🎉 This PR is included in version 24.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Context
related screwdriver-cd/screwdriver#3191
screwdriver-cd/models#612 added archived to the job table filter in the job template metrics.
However, since the only index in the job table is
templateId
, the index does not work effectively and the job template details page takes a long time to load.Objective
Create an index for
templateId
andarchived
to speed up the loading of template detail pagesReferences
screwdriver-cd/screwdriver#3191
License
I confirm that this contribution is made under the terms of the license found in the root directory of this repository's source tree and that I have the authority necessary to make this contribution on behalf of its copyright owner.