Skip to content

Conversation

@marcelklehr
Copy link
Member

@marcelklehr marcelklehr commented Mar 24, 2025

to improve performance by using the db index

Summary

We found a query like this that doesn't use the available index and seems to cause a table scan, which seems to be due to the use of OR instead of IN.

Thanks to @Altahrim for figuring this out.

Checklist

@marcelklehr marcelklehr requested a review from a team as a code owner March 24, 2025 14:42
@marcelklehr marcelklehr requested review from come-nc, nfebe and provokateurin and removed request for a team March 24, 2025 14:42
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

perf would be the right conventional commit type ;)

@marcelklehr marcelklehr requested a review from icewind1991 March 25, 2025 07:49
…equals

to improve performance by using the db index

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr force-pushed the refactor/use-in-instead-of-or branch from eb72f1d to b464469 Compare March 25, 2025 08:42
@marcelklehr marcelklehr changed the title refactor(sharing): Use oc_share.item_type IN instead of OR equals perf(sharing): Use oc_share.item_type IN instead of OR equals Mar 25, 2025
@provokateurin provokateurin enabled auto-merge March 25, 2025 10:06
@provokateurin provokateurin added 3. to review Waiting for reviews performance 🚀 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Mar 25, 2025
@provokateurin provokateurin added this to the Nextcloud 32 milestone Mar 25, 2025
@provokateurin provokateurin merged commit eab608f into master Mar 25, 2025
230 of 240 checks passed
@provokateurin provokateurin deleted the refactor/use-in-instead-of-or branch March 25, 2025 10:52
@marcelklehr
Copy link
Member Author

Do we backport this?

@provokateurin
Copy link
Member

I'd say no, as nobody has been complaining about these exact queries causing performance problems.
Of course it's still a nice improvement for 32 nevertheless.

@marcelklehr
Copy link
Member Author

I have a ticket from a customer where these are problematic among others. They are on 29

@marcelklehr
Copy link
Member Author

/backport to stable31

@marcelklehr
Copy link
Member Author

/backport to stable30

@skjnldsv skjnldsv modified the milestones: Nextcloud 33, Nextcloud 32 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish performance 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants