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 06:40:20 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-03-18 06:40:20 +0300
commit6e8ec4575c1b19af63fe4910dd0dd7c5dc8a6003 (patch)
tree043835e20d15cc352de0ea6cfbc4696aaabc4648 /core/ArchiveProcessor.php
parentbf56078002db6c9d1bd5653443486b9148af76b0 (diff)
faster archive by calculating the recursive count only if needed
Diffstat (limited to 'core/ArchiveProcessor.php')
-rw-r--r--core/ArchiveProcessor.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php
index 81ac213344..8f7b979915 100644
--- a/core/ArchiveProcessor.php
+++ b/core/ArchiveProcessor.php
@@ -187,6 +187,8 @@ 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
* @return array Returns the row counts of each aggregated report before truncation, eg,
*
* array(
@@ -203,7 +205,8 @@ class ArchiveProcessor
$maximumRowsInSubDataTable = null,
$columnToSortByBeforeTruncation = null,
&$columnsAggregationOperation = null,
- $columnsToRenameAfterAggregation = null)
+ $columnsToRenameAfterAggregation = null,
+ $countRowsRecursive = true)
{
if (!is_array($recordNames)) {
$recordNames = array($recordNames);
@@ -216,8 +219,9 @@ class ArchiveProcessor
$table = $this->aggregateDataTableRecord($recordName, $columnsAggregationOperation, $columnsToRenameAfterAggregation);
$nameToCount[$recordName]['level0'] = $table->getRowsCount();
-
- $nameToCount[$recordName]['recursive'] = $table->getRowsCountRecursive();
+ if ($countRowsRecursive) {
+ $nameToCount[$recordName]['recursive'] = $table->getRowsCountRecursive();
+ }
$blob = $table->getSerialized($maximumRowsInDataTableLevelZero, $maximumRowsInSubDataTable, $columnToSortByBeforeTruncation);
Common::destroy($table);