summaryrefslogtreecommitdiffstats
path: root/web/api
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-26 17:10:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-26 17:10:03 +0000
commit271f618a49421e87945c1f68b59a8775469390d5 (patch)
tree166cbc9497e13b878bdd7043ca58f6b3da006f2a /web/api
parentAdding upstream version 1.43.0. (diff)
downloadnetdata-271f618a49421e87945c1f68b59a8775469390d5.tar.xz
netdata-271f618a49421e87945c1f68b59a8775469390d5.zip
Adding upstream version 1.43.1.upstream/1.43.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/api')
-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 8a4e94c9..b7e89ee9 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,