Skip to content

Add index to foreign key (parent_id) column for optimized record retrieval & deletion #84

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akhil018
Copy link

@akhil018 akhil018 commented Dec 20, 2023

The problem was identified in the foreign key(parent_id) column, where retrieval and deletion of records took an unexpectedly long time. To optimize the retrieval and deletion process, this fix introduces a new index on the relevant foreign key (parent_id) column.

This commit addresses performance issues related to both record deletion and retrieval in the sqlalchemy_mptt library. Adding an index to the foreign key(parent_id) column improves the efficiency of both operations, significantly reducing the time taken for deletion and retrieval.

This commit addresses performance issues related to both record deletion and retrieval in the sqlalchemy_mptt library. Adding an index to the foreign key(parent_id) column improves the efficiency of both operations, significantly reducing the time taken for deletion and retrieval.
@fayazkhan
Copy link
Collaborator

@akhil018 could you help in attempting to write a corresponding test for this change?

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.

2 participants