Commit 5820c5446bdaa5b5a2f5851115d6c98ee4bf0bcb
Committed by
Andrew Shvayka
1 parent
430e96cd
Do not load all data if it is not in the current time interval
Showing
1 changed file
with
3 additions
and
1 deletions
@@ -434,7 +434,9 @@ public class DefaultSubscriptionManagerService extends TbApplicationEventListene | @@ -434,7 +434,9 @@ public class DefaultSubscriptionManagerService extends TbApplicationEventListene | ||
434 | if (curTs > value) { | 434 | if (curTs > value) { |
435 | long startTs = subscription.getStartTime() > 0 ? Math.max(subscription.getStartTime(), value + 1L) : (value + 1L); | 435 | long startTs = subscription.getStartTime() > 0 ? Math.max(subscription.getStartTime(), value + 1L) : (value + 1L); |
436 | long endTs = subscription.getEndTime() > 0 ? Math.min(subscription.getEndTime(), curTs) : curTs; | 436 | long endTs = subscription.getEndTime() > 0 ? Math.min(subscription.getEndTime(), curTs) : curTs; |
437 | - queries.add(new BaseReadTsKvQuery(key, startTs, endTs, 0, 1000, Aggregation.NONE)); | 437 | + if (startTs > 1) { |
438 | + queries.add(new BaseReadTsKvQuery(key, startTs, endTs, 0, 1000, Aggregation.NONE)); | ||
439 | + } | ||
438 | } | 440 | } |
439 | }); | 441 | }); |
440 | if (!queries.isEmpty()) { | 442 | if (!queries.isEmpty()) { |