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

Analytics: create DB index on PageView.date #10426

Merged
merged 1 commit into from Jun 14, 2023
Merged

Conversation

humitos
Copy link
Member

@humitos humitos commented Jun 13, 2023

We use this field to run cleaup
tasks (readthedocs.analytics.tasks.delete_old_page_counts). Having an index on this field will help a lot to improve these queries.

Related https://github.com/readthedocs/readthedocs-ops/issues/1291

We use this field to run cleaup
tasks (`readthedocs.analytics.tasks.delete_old_page_counts`). Having an index on
this field will help a lot to improve these queries.

Related readthedocs/readthedocs-ops#1291
@humitos humitos requested a review from stsewd June 13, 2023 11:15
@humitos humitos requested a review from a team as a code owner June 13, 2023 11:15
@humitos
Copy link
Member Author

humitos commented Jun 13, 2023

Should we disable the feature flag before running this migration? I think it blocks the table to create the index, right?

@stsewd
Copy link
Member

stsewd commented Jun 13, 2023

yeah, probably good idea doing that.

@humitos humitos merged commit e8f4887 into main Jun 14, 2023
7 checks passed
@humitos humitos deleted the humitos/pageview-date-index branch June 14, 2023 09:17
@ericholscher
Copy link
Member

I don't believe creating an index would block the table unless it's an exclusive index (unique together, for example), but I'm not 100% sure.

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.

None yet

3 participants