Skip to content

Conversation

@blizzz
Copy link
Member

@blizzz blizzz commented Apr 22, 2021

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).

@blizzz
Copy link
Member Author

blizzz commented Apr 22, 2021

/backport to stable21

@blizzz
Copy link
Member Author

blizzz commented Apr 22, 2021

/backport to stable20

$storageCount++;
$fileQuery->setParameter('storageId', $storageRow['id']);
$fileResult = $fileQuery->execute();
$fileCount += (int)$fileResult->fetchOne();
Copy link
Collaborator

Choose a reason for hiding this comment

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

fetchOne is not available for 20 :(

Copy link
Member

Choose a reason for hiding this comment

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

so adjust on the backport to fetchColumn()

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, this here goes against 22. Backports get their care when due.

@blizzz blizzz force-pushed the fix/noid/background-count branch from a00b0eb to 495775c Compare April 23, 2021 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants