add to log when overviews are being used in dataviews
This commit is contained in:
parent
de30ab99ef
commit
8ef260972d
@ -64,7 +64,13 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
return callback(null, dataviewResult);
|
||||
const stats = {};
|
||||
|
||||
if (dataviewResult && dataviewResult.usesOverviews) {
|
||||
stats.usesOverviews = dataviewResult.usesOverviews;
|
||||
}
|
||||
|
||||
return callback(null, dataviewResult, stats);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
@ -21,7 +21,7 @@ function getPGTypeName (pgType) {
|
||||
|
||||
module.exports = class BaseDataview {
|
||||
getResult (psql, override, callback) {
|
||||
this.sql(psql, override, (err, query) => {
|
||||
this.sql(psql, override, (err, query, flags = { usesOverviews : false }) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@ -33,7 +33,8 @@ module.exports = class BaseDataview {
|
||||
|
||||
result = this.format(result, override);
|
||||
result.type = this.getType();
|
||||
|
||||
result.usesOverviews = flags.usesOverviews;
|
||||
|
||||
return callback(null, result);
|
||||
|
||||
}, true); // use read-only transaction
|
||||
|
@ -209,7 +209,7 @@ Aggregation.prototype.sql = function(psql, override, callback) {
|
||||
|
||||
debug(aggregationSql);
|
||||
|
||||
return callback(null, aggregationSql);
|
||||
return callback(null, aggregationSql, { usesOverviews: true });
|
||||
};
|
||||
|
||||
var aggregationFnQueryTpl = {
|
||||
|
@ -74,5 +74,5 @@ Formula.prototype.sql = function (psql, override, callback) {
|
||||
|
||||
debug(formulaSql);
|
||||
|
||||
return callback(null, formulaSql);
|
||||
return callback(null, formulaSql, { usesOverviews: true });
|
||||
};
|
||||
|
@ -178,7 +178,7 @@ Histogram.prototype.sql = function(psql, override, callback) {
|
||||
|
||||
var histogramSql = this._buildQuery(override);
|
||||
|
||||
return callback(null, histogramSql);
|
||||
return callback(null, histogramSql, { usesOverviews: true });
|
||||
};
|
||||
|
||||
Histogram.prototype._buildQuery = function (override) {
|
||||
|
Loading…
Reference in New Issue
Block a user