From 547c4940ecd1e21f71e587ab3693660d29ed5bd5 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Tue, 9 Sep 2025 10:33:38 +0300 Subject: [PATCH] skip empty removeIndexKeys to avoid slow ops --- engine/libindex.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/libindex.go b/engine/libindex.go index f1f9cb4d0..d888803c4 100644 --- a/engine/libindex.go +++ b/engine/libindex.go @@ -237,6 +237,9 @@ func UpdateFilterIndexes(dm *DataManager, tnt string, oldFltr *Filter, newFltr * // Used to update the index map when a filter is modified. func removeFilterIndexesForFilter(dm *DataManager, idxItmType, cacheItmType, tnt string, removeIndexKeys []string, itemIDs utils.StringMap) error { + if len(removeIndexKeys) == 0 { + return nil // no indexes to remove + } refID := guardian.Guardian.GuardIDs(utils.EmptyString, config.CgrConfig().GeneralCfg().LockingTimeout, idxItmType+tnt) defer guardian.Guardian.UnguardIDs(refID)