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

perf: Add index for group_folders table #3390

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

provokateurin
Copy link
Member

@provokateurin provokateurin commented Oct 29, 2024

We do a lot of SELECTs on this table in the FolderManager, but there is actually no index on it at all. All SELECTs include all columns, so that's why I'm not adding one for folder_id only.
Usually not noticable when there aren't many groupfolders, but if you got a few then it can take a bit too long.

@provokateurin provokateurin force-pushed the perf/group_folders-table-index branch from 201ece6 to 60ff87b Compare October 29, 2024 13:52
@provokateurin provokateurin requested a review from artonge October 29, 2024 13:52
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

I doubt it would improve anything given that I don't see how the number of groupfolders could be higher than 1000. And with that amount, an index would hardly make a difference, no?

But I guess it does not hurt

@provokateurin
Copy link
Member Author

Not substantial performance improvements measured, we can still add it later if needed.

@icewind1991
Copy link
Member

There are instances with 10k+ groupfolders so having an index probably makes sense.

@provokateurin
Copy link
Member Author

Ok, then we can add it. I would have expected that there already is an index in case anyone already suffered performance problems from the lack of an index on the table.

@provokateurin provokateurin reopened this Nov 4, 2024
@provokateurin
Copy link
Member Author

/backport to stable30

@provokateurin
Copy link
Member Author

/backport to stable29

@provokateurin
Copy link
Member Author

/backport to stable28

@come-nc come-nc force-pushed the perf/group_folders-table-index branch from 8dd95d3 to 60ff84c Compare January 9, 2025 14:06
@come-nc come-nc merged commit 27995fb into master Jan 9, 2025
44 checks passed
@come-nc come-nc deleted the perf/group_folders-table-index branch January 9, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Items that need to be reviewed performance 🚀
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants