Skip to content
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

fix: optimise pin content cid query #1573

Merged
merged 2 commits into from
Jun 27, 2022
Merged

Conversation

flea89
Copy link
Contributor

@flea89 flea89 commented Jun 27, 2022

Create an index on pin(content_cid, status) to speed up user_used_storage joining and filtering.

I'll create a separate issue to audit the use of CREATE INDEX IF NOT EXISTS pin_status_idx ON pin (status); and to verify if it can be dropped in favor of this new one.

Storage Limit Email Notifications Storage Limit Email Notifications #43 ran on staging in 11 minutes. ( staging amount of data is now comparable to prod).

🛑 The index has already been created in STAGING to test the performance against a large amount of data.

@adamalton adamalton changed the title Fix/optimise pin content cid query fix: optimise pin content cid query Jun 27, 2022
Copy link
Contributor

@adamalton adamalton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flea89 flea89 merged commit c315143 into main Jun 27, 2022
@flea89 flea89 deleted the fix/optimise-pin-content-cid-query branch June 27, 2022 14:42
@vasco-santos
Copy link
Contributor

Applying index in prod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants