-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Added composite index to posts table for type,status #20437
Conversation
ref https://linear.app/tryghost/issue/CFR-35 - performance improvement intended for the content api/get helpers The posts table is shared by posts and pages and seldom is queried for both. It makes sense to add an index on type, and from the perspective of the content API, also on status as you're almost only ever querying for published posts or published pages.
It looks like this PR contains a migration 👀 General requirements
Schema changes
Data changes
|
Index is added in a few ms for a test set of 20k posts. This may be a bit longer for the couple biggest customers - I think the largest has ~125k posts, but all in all is very quick. |
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.
Version needs bumping
we had a release while this PR was sitting so we need to make sure this runs on the next released version
ref https://linear.app/tryghost/issue/CFR-35
The posts table is shared by posts and pages and seldom is queried for both. It makes sense to add an index on type, and from the perspective of the content API, also on status as you're almost only ever querying for published posts or published pages.