Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <thomas.steur@gmail.com>2015-03-18 07:20:08 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-03-18 07:20:08 +0300
commitd532912e01eca79fa94df09578e59a94fb7c6511 (patch)
tree03662b9e901eeaa9c576af67dcf30395b5034c43 /core/ArchiveProcessor.php
parent892eef9497a38e960a3a258bd23562f521b00115 (diff)
fix a couple of bugs and actually only count the recursive rows count if needed
Diffstat (limited to 'core/ArchiveProcessor.php')
-rw-r--r--core/ArchiveProcessor.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php
index 8f7b979915..31f79b61a8 100644
--- a/core/ArchiveProcessor.php
+++ b/core/ArchiveProcessor.php
@@ -187,8 +187,9 @@ class ArchiveProcessor
* @param array $columnsToRenameAfterAggregation Columns mapped to new names for columns that must change names
* when summed because they cannot be summed, eg,
* `array('nb_uniq_visitors' => 'sum_daily_nb_uniq_visitors')`.
- * @param bool $countRowsRecursive if set to false, will not calculate the recursive rows count which results in
- * faster aggregation
+ * @param bool|array $countRowsRecursive if set to true, will calculate the recursive rows count for all record names
+ * which makes it slower. If you only need it for some records pass an array of
+ * recordNames that defines for which ones you need a recursive row count.
* @return array Returns the row counts of each aggregated report before truncation, eg,
*
* array(
@@ -219,7 +220,7 @@ class ArchiveProcessor
$table = $this->aggregateDataTableRecord($recordName, $columnsAggregationOperation, $columnsToRenameAfterAggregation);
$nameToCount[$recordName]['level0'] = $table->getRowsCount();
- if ($countRowsRecursive) {
+ if ($countRowsRecursive === true || (is_array($countRowsRecursive) && in_array($recordName, $countRowsRecursive))) {
$nameToCount[$recordName]['recursive'] = $table->getRowsCountRecursive();
}