Uh oh!
There was an error while loading. Please reload this page.
Use storage filter when fetching previews to cleanup - #28610
Merged
Conversation
Signed-off-by: Julius Härtl <jus@bitgrid.net>
juliusknorrforce-pushed
the
enh/preview-cleanup-query
branch
from
August 26, 2021 20:03
a7fc321 to
0670118Comparekesselb
approved these changes
Aug 26, 2021
kesselb
left a comment
Contributor
There was a problem hiding this comment.
LGTM 👍
With storage id fs_storage_mimetype index is used on my setup.
skjnldsv
approved these changes
Dec 28, 2021
skjnldsv
commented
Dec 28, 2021
Member
ready when you are @juliushaertl |
juliusknorr
commented
Dec 28, 2021
MemberAuthor
Did another check and this also seems to resolve #28114 where then the partial path index EXPLAIN SELECT`a`.`name`FROM`oc_filecache``a`LEFT JOIN`oc_filecache``b`ON`a`.`name`=`b`.`fileid`WHERE (`a`.`storage`=2 ) AND (`b`.`fileid` IS NULL) AND (`a`.`path`LIKE'appdata\\_ocvsye5pcvs4/preview/_/_/_/_/_/_/_/%');
+------+-------------+-------+--------+-----------------------------------------------------------------------------------------------------+------------------------+---------+------------------+------+--------------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------+--------+-----------------------------------------------------------------------------------------------------+------------------------+---------+------------------+------+--------------------------------------+
| 1 | SIMPLE | a | range | fs_storage_path_hash,fs_storage_mimetype,fs_storage_mimepart,fs_storage_size,fs_storage_path_prefix | fs_storage_path_prefix | 267 | NULL | 282 | Using index condition; Using where |
| 1 | SIMPLE | b | eq_ref | PRIMARY,fs_id_storage_size | PRIMARY | 8 | nextcloud.a.name | 1 | Using where; Using index; Not exists |
+------+-------------+-------+--------+-----------------------------------------------------------------------------------------------------+------------------------+---------+------------------+------+--------------------------------------+2 rows inset (0.016 sec)
|
juliusknorr
commented
Dec 28, 2021
MemberAuthor
/backport to stable23 |
juliusknorr
commented
Dec 28, 2021
MemberAuthor
/backport to stable22 |
juliusknorr
commented
Dec 28, 2021
MemberAuthor
/backport to stable21 |
The backport to stable21 failed. Please do this backport manually. |
The backport to stable22 failed. Please do this backport manually. |
The backport to stable23 failed. Please do this backport manually. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First attempt to speed up the slow query that is used to cleaning up previews a bit as described in #28114 in order to at least use the indexed storage column which would always be the root storage where the app data is located
The query is still quite bad with larger amounts of previews, but I don't see any further way to improve that other than basically moving back the preview cleanup to the actual deletion of files which of course would bring back the risk of timing out requests as described in 3e07c4f
I'll put some further ideas into #28114