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

@solracsf solracsf added the 2. developing Work in progress label Jan 13, 2022
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/stable22 branch from f2346dd to 9f2b50d Compare January 13, 2022 14:45
@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.

👍

@MichaIng MichaIng merged commit 3622942 into stable22 Jan 13, 2022
@MichaIng MichaIng deleted the backport/29118/stable22 branch January 13, 2022 22:01
@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

2. developing Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants