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

Add Indices to Foreign Key Columns in SubscribedSubredditData, SubscribedUserData and MultiReddit #1687

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

adripo
Copy link
Contributor

@adripo adripo commented Jul 24, 2024

Description:

Problem:

In the current implementation, the username column in the SubscribedSubredditData, SubscribedUserData, and MultiReddit tables references a foreign key but is not indexed. This may trigger full table scans whenever the parent table is modified, leading to performance issues.
Details: https://github.com/Docile-Alligator/Infinity-For-Reddit/actions/runs/10067294236/job/27830465944#step:4:109

Solution:

To resolve this, indices have been added to the username columns in the database tables. Additionally, the database schema version has been incremented and migration strategies have been provided to handle the creation of these indices.

Testing:

  • Verified that the indices are created successfully during migration.
  • Ensured that the application runs without performance warnings.

Checklist:

  • Added @Index annotation to username columns.
  • Incremented the database version.
  • Provided migration strategies.
  • Verified successful migration and absence of performance warnings.

Please review and merge the changes.

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.

1 participant