-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Grapher baking performance enhancements #3482
Conversation
71101e6
to
f9f3bdd
Compare
Continued to work on this for a bit, think this is ready for review now. Observed performance of |
export class AddPostsSlugIndex1712842552502 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`-- sql | ||
ALTER TABLE posts ADD INDEX idx_posts_slug (slug(100)); |
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.
I think we should bump this to 130 maybe? The longest slug in my snapshot is 122 chars long. As far as I understand indices in mysql this would still work but why not make it a bit bigger and then all values will fit.
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.
Hm, I honestly don't think it's necessary (unless we would want this index to be unique).
Otherwise, there are quite certainly not gonna be two slugs whose prefixes of length 100 are the same length, and then it's just the same.
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.
Looks good! I think we should maybe bump the index size up a bit but it should work also without that.
Various attempts to improve #3462