-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[db] Add index to d_b_workspace_instance on startedTime & stoppingTime #12706
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
Conversation
|
/werft run 👍 started the job as gitpod-build-mp-db-workspace-instance-time-idx.1 |
|
|
||
| const startedTimeIndex = "IDX_workspace_instance__started_time"; | ||
| if (!(await indexExists(queryRunner, TABLE_NAME, startedTimeIndex))) { | ||
| await queryRunner.query(`CREATE INDEX ${startedTimeIndex} ON ${TABLE_NAME} (startedTime)`); |
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.
Do we need the magical , ALGORITHM=INPLACE, LOCK=NONE statement here?
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.
magical
Link to MySQL docs: https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl-operations.html
tl;dr: no, adding 2ndary indexes is a in-place operation that does not lock.
This is more relevant for adding primary keys, or re-naming (cmp. docs).
|
Removing auto-link to close #13060, just landing the PR doesn't actually fix the issue so we need to track manually. |
|
@easyCZ We could merge this one now, right? 🤔 |
|
@geropl Yep! I'll just create a new migration and move the contents of this one to ensure the TS is most recent. I'm unsure exactly how the migrations handle cases where the migrations in the past is inserted. |
It handles it well, e.g. does identity by name, and performs all which have not yet been executed. 👍 But maintaining order is nice as well 🙃 |
155b312 to
3e92f33
Compare
|
@geropl Thanks. I've moved the file anyway just to keep it clean. /unhold |
Description
Adds missing indices to avoid full table scan.
Internal Context
Related Issue(s)
Relates to #13060
How to test
Release Notes
Documentation
Werft options:
/hold to run this manually as it is a long-running migration.