1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

more comments

This commit is contained in:
Damodar Lohani 2021-08-30 15:23:11 +05:45
parent 2477b80978
commit 87311797f2

View file

@ -310,17 +310,14 @@ $cli
}
/**
* Aggregate MariaDB every 15 minutes
* Some of the queries here might contain full-table scans.
*/
if ($iterations % 30 == 0) { // Every 15 minutes
// Aggregate number of objects in database
// Get count of all the documents per collection -
// Buckets will have the same
* Aggregate MariaDB every 15 minutes
* Some of the queries here might contain full-table scans.
*/
if ($iterations % 30 == 0) { // Every 15 minutes aggregate number of objects in database
$latestProject = null;
do {
do { // Loop over all the projects
$projects = $dbForConsole->find('projects', [], 100, orderAfter:$latestProject);
if (empty($projects)) {
@ -440,7 +437,7 @@ $cli
$latestParent = null;
$subCollectionCounts = []; //total project level count of sub collections
do {
do { // Loop over all the parent collection document for each sub collection
$dbForProject->setNamespace("project_{$projectId}_{$options['namespace']}");
$parents = $dbForProject->find($collection, [], 100, orderAfter:$latestParent); // Get all the parents for the sub collections for example for documents, this will get all the collections