Skip to content

Conversation

@backportbot-nextcloud
Copy link

@backportbot-nextcloud backportbot-nextcloud bot commented Jan 11, 2022

backport of #29118

@PVince81
Copy link
Member

@icewind1991 please resolve the conflict

for the following query 'SELECT "path" FROM "oc_filecache" WHERE ("storage" = $storage) AND ("size" < 0) ORDER BY "fileid" DESC LIMIT 1;'

currently the database will in some cases decide to priorize the sort by fileid over the filter when picking what index to use, resulting in a much slower query.

by creating an index that allows first sorting by fileid and also filter by storage and size this case will be greatly sped up

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 force-pushed the backport/29118/stable21 branch from bbc3822 to 3a1935b Compare January 13, 2022 14:48
@icewind1991
Copy link
Member

rebased

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@MichaIng MichaIng left a comment

Choose a reason for hiding this comment

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

Static code analysis fixed with #30596.

@MichaIng MichaIng merged commit c7e45ee into stable21 Jan 13, 2022
@MichaIng MichaIng deleted the backport/29118/stable21 branch January 13, 2022 22:02
@blizzz blizzz mentioned this pull request Jan 14, 2022
This was referenced Jan 20, 2022
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.

5 participants