summaryrefslogtreecommitdiffstats
path: root/web/api/queries/query.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-26 17:10:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-26 17:10:18 +0000
commitbb3cae2edeb7b698c9dfcbe74df9eb17d03c771b (patch)
tree55748ed1435e5a5221b91426ecd284ffa1fe7094 /web/api/queries/query.c
parentReleasing debian version 1.43.0-1. (diff)
downloadnetdata-bb3cae2edeb7b698c9dfcbe74df9eb17d03c771b.tar.xz
netdata-bb3cae2edeb7b698c9dfcbe74df9eb17d03c771b.zip
Merging upstream version 1.43.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--web/api/queries/query.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/api/queries/query.c b/web/api/queries/query.c
index 8a4e94c96..b7e89ee97 100644
--- a/web/api/queries/query.c
+++ b/web/api/queries/query.c
@@ -1391,9 +1391,10 @@ static bool query_plan(QUERY_ENGINE_OPS *ops, time_t after_wanted, time_t before
// find the first time of this tier
time_t tier_first_time_s = qm->tiers[tr].db_first_time_s;
+ time_t tier_last_time_s = qm->tiers[tr].db_last_time_s;
// can it help?
- if (tier_first_time_s < selected_tier_first_time_s) {
+ if (tier_first_time_s < selected_tier_first_time_s && tier_first_time_s <= before_wanted && tier_last_time_s >= after_wanted) {
// it can help us add detail at the beginning of the query
QUERY_PLAN_ENTRY t = {
.tier = tr,
@@ -1423,12 +1424,13 @@ static bool query_plan(QUERY_ENGINE_OPS *ops, time_t after_wanted, time_t before
continue;
// find the last time of this tier
+ time_t tier_first_time_s = qm->tiers[tr].db_first_time_s;
time_t tier_last_time_s = qm->tiers[tr].db_last_time_s;
//buffer_sprintf(wb, ": EVAL BEFORE tier %d, %ld", tier, last_time_s);
// can it help?
- if (tier_last_time_s > selected_tier_last_time_s) {
+ if (tier_last_time_s > selected_tier_last_time_s && tier_first_time_s <= before_wanted && tier_last_time_s >= after_wanted) {
// it can help us add detail at the end of the query
QUERY_PLAN_ENTRY t = {
.tier = tr,