Skip to content

Commit

Permalink
Merge pull request #309 from jjrom/develop
Browse files Browse the repository at this point in the history
Major speed improvement in getCount when heatmapNoGeo is requested
  • Loading branch information
jjrom authored Apr 9, 2022
2 parents 0b25eb9 + 0a2bcca commit 15b401a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/resto/core/dbfunctions/FeaturesFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ public function search($context, $user, $model, $collections, $params, $sorting)
*/
if ( isset($context->query['_heatmapNoGeo']) && filter_var($context->query['_heatmapNoGeo'], FILTER_VALIDATE_BOOLEAN) ) {
$whereClause = $filtersFunctions->getWhereClause($filtersAndJoins, array('sort' => false, 'addGeo' => false));
$heatmapLink = (new Heatmap($context, $user))->getEndPoint($featureTableName, $whereClause, $this->getCount('FROM ' . $featureTableName . ' ' . $whereClause, $params), $wkt);
// [IMPORTANT] Set empty $params in getCount() to avoid computation of real count
$heatmapLink = (new Heatmap($context, $user))->getEndPoint($featureTableName, $whereClause, $this->getCount('FROM ' . $featureTableName . ' ' . $whereClause), $wkt);
}
else {
for ($i = count($filtersAndJoins['filters']); $i--;) {
Expand Down

0 comments on commit 15b401a

Please sign in to comment.