diff --git a/packages/unleash-api/lib/db/client-metrics.js b/packages/unleash-api/lib/db/client-metrics.js index c1781673f2..9efd26d9f5 100644 --- a/packages/unleash-api/lib/db/client-metrics.js +++ b/packages/unleash-api/lib/db/client-metrics.js @@ -14,6 +14,7 @@ module.exports = function (db) { return db .select(METRICS_COLUMNS) .from(TABLE) + .limit(2000) .whereRaw('created_at > now() - interval \'7 day\'') .orderBy('created_at', 'asc') .map(mapRow); @@ -24,6 +25,7 @@ module.exports = function (db) { return db .select(METRICS_COLUMNS) .from(TABLE) + .limit(1000) .where('id', '>', lastKnownId) .orderBy('created_at', 'asc') .map(mapRow);