move counting storage statistics to the background#297
Merged
Conversation
Member
Author
|
/backport to stable21 |
Member
Author
|
/backport to stable20 |
kesselb
reviewed
Apr 22, 2021
| $storageCount++; | ||
| $fileQuery->setParameter('storageId', $storageRow['id']); | ||
| $fileResult = $fileQuery->execute(); | ||
| $fileCount += (int)$fileResult->fetchOne(); |
Collaborator
There was a problem hiding this comment.
fetchOne is not available for 20 :(
Member
There was a problem hiding this comment.
so adjust on the backport to fetchColumn()
Member
Author
There was a problem hiding this comment.
Yup, this here goes against 22. Backports get their care when due.
kesselb
approved these changes
Apr 22, 2021
a00b0eb to
495775c
Compare
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This was referenced Apr 23, 2021
8 tasks
This was referenced Jun 5, 2023
4 tasks
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 free
to 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.
Previously we had a
COUNT(*)against the filecache table. At least on MySQL's InnoDB this caused a full table scan and could result on MySQL quitting for a too long running query. Since it was done live it also meant long loading times for the web interface as well as API call.This change moves the counting into the background and uses a cached value only. By default it is being updated every three hours, but can be configured via app config (example added in README). Further, it can be triggered manually via occ command (example also in README).