diff --git a/ChangeLog.d/bugfix/ZBX-26419 b/ChangeLog.d/bugfix/ZBX-26419
new file mode 100644
index 00000000000..3d838afa903
--- /dev/null
+++ b/ChangeLog.d/bugfix/ZBX-26419
@@ -0,0 +1 @@
+..F....... [ZBX-26419] improved performance of problem and event views by optimizing SQL queries to join only the necessary triggers, eliminating redundant post-join filtering (vso)
diff --git a/ui/include/classes/api/services/CAlert.php b/ui/include/classes/api/services/CAlert.php
index c8d831705c4..ff9b3b6775c 100644
--- a/ui/include/classes/api/services/CAlert.php
+++ b/ui/include/classes/api/services/CAlert.php
@@ -212,12 +212,12 @@ class CAlert extends CApiService {
 				$sql_parts['where'][] = 'NOT EXISTS ('.
 					'SELECT NULL'.
 					' FROM functions f1'.
-					' JOIN items i1 ON f1.itemid=i1.itemid'.
+					' JOIN items i1 ON f1.itemid=i1.itemid and f1.itemid!=i.itemid'.
 					' JOIN host_hgset hh1 ON i1.hostid=hh1.hostid'.
 					' LEFT JOIN permission p1 ON hh1.hgsetid=p1.hgsetid'.
 						' AND p1.ugsetid=p.ugsetid'.
-					' WHERE e.objectid=f1.triggerid'.
-						' AND p1.permission IS NULL'.
+					' WHERE f.triggerid=f1.triggerid'.
+						' AND p1.hgsetid IS NULL'.
 				')';
 			}
 			elseif (in_array($options['eventobject'], [EVENT_OBJECT_ITEM, EVENT_OBJECT_LLDRULE])) {
diff --git a/ui/include/classes/api/services/CEvent.php b/ui/include/classes/api/services/CEvent.php
index 1173b66c966..4c24c94bae6 100644
--- a/ui/include/classes/api/services/CEvent.php
+++ b/ui/include/classes/api/services/CEvent.php
@@ -240,12 +240,12 @@ class CEvent extends CApiService {
 				$sql_parts['where'][] = 'NOT EXISTS ('.
 					'SELECT NULL'.
 					' FROM functions f1'.
-					' JOIN items i1 ON f1.itemid=i1.itemid'.
+					' JOIN items i1 ON f1.itemid=i1.itemid and f1.itemid!=i.itemid'.
 					' JOIN host_hgset hh1 ON i1.hostid=hh1.hostid'.
 					' LEFT JOIN permission p1 ON p1.hgsetid=hh1.hgsetid'.
 						' AND p1.ugsetid=p.ugsetid'.
-					' WHERE e.objectid=f1.triggerid'.
-						' AND p1.permission IS NULL'.
+					' WHERE f.triggerid=f1.triggerid'.
+						' AND p1.hgsetid IS NULL'.
 				')';
 
 				if ($options['source'] == EVENT_SOURCE_TRIGGERS) {
diff --git a/ui/include/classes/api/services/CGraph.php b/ui/include/classes/api/services/CGraph.php
index 65f92e054c3..32e46c0c97b 100644
--- a/ui/include/classes/api/services/CGraph.php
+++ b/ui/include/classes/api/services/CGraph.php
@@ -124,7 +124,7 @@ class CGraph extends CGraphGeneral {
 				' LEFT JOIN permission p1 ON hh1.hgsetid=p1.hgsetid'.
 					' AND p1.ugsetid=p.ugsetid'.
 				' WHERE g.graphid=gi1.graphid'.
-					' AND p1.permission IS NULL'.
+					' AND p1.hgsetid IS NULL'.
 			')';
 		}
 
diff --git a/ui/include/classes/api/services/CGraphItem.php b/ui/include/classes/api/services/CGraphItem.php
index 917c65b68fe..f5251b19d6a 100644
--- a/ui/include/classes/api/services/CGraphItem.php
+++ b/ui/include/classes/api/services/CGraphItem.php
@@ -87,7 +87,7 @@ class CGraphItem extends CApiService {
 				' LEFT JOIN permission p1 ON hh1.hgsetid=p1.hgsetid'.
 					' AND p1.ugsetid=p.ugsetid'.
 				' WHERE gi.graphid=gi1.graphid'.
-					' AND p1.permission IS NULL'.
+					' AND p1.hgsetid IS NULL'.
 			')';
 		}
 
diff --git a/ui/include/classes/api/services/CGraphPrototype.php b/ui/include/classes/api/services/CGraphPrototype.php
index f196fa21168..5e21d483c0d 100644
--- a/ui/include/classes/api/services/CGraphPrototype.php
+++ b/ui/include/classes/api/services/CGraphPrototype.php
@@ -123,7 +123,7 @@ class CGraphPrototype extends CGraphGeneral {
 				' LEFT JOIN permission p1 ON hh1.hgsetid=p1.hgsetid'.
 					' AND p1.ugsetid=p.ugsetid'.
 				' WHERE g.graphid=gi1.graphid'.
-					' AND p1.permission IS NULL'.
+					' AND p1.hgsetid IS NULL'.
 			')';
 		}
 
diff --git a/ui/include/classes/api/services/CProblem.php b/ui/include/classes/api/services/CProblem.php
index 2c9a7457c4d..2d48db29eb7 100644
--- a/ui/include/classes/api/services/CProblem.php
+++ b/ui/include/classes/api/services/CProblem.php
@@ -149,12 +149,12 @@ class CProblem extends CApiService {
 				$sql_parts['where'][] = 'NOT EXISTS ('.
 					'SELECT NULL'.
 					' FROM functions f1'.
-					' JOIN items i1 ON f1.itemid=i1.itemid'.
+					' JOIN items i1 ON f1.itemid=i1.itemid and f1.itemid!=i.itemid'.
 					' JOIN host_hgset hh1 ON i1.hostid=hh1.hostid'.
 					' LEFT JOIN permission pp1 ON hh1.hgsetid=pp1.hgsetid'.
 						' AND pp1.ugsetid=pp.ugsetid'.
-					' WHERE p.objectid=f1.triggerid'.
-						' AND pp1.permission IS NULL'.
+					' WHERE f.triggerid=f1.triggerid'.
+						' AND pp1.hgsetid IS NULL'.
 				')';
 
 				if ($options['source'] == EVENT_SOURCE_TRIGGERS) {
diff --git a/ui/include/classes/api/services/CTrigger.php b/ui/include/classes/api/services/CTrigger.php
index 8d5dba8d962..2159b6258c7 100644
--- a/ui/include/classes/api/services/CTrigger.php
+++ b/ui/include/classes/api/services/CTrigger.php
@@ -152,12 +152,12 @@ class CTrigger extends CTriggerGeneral {
 			$sqlParts['where'][] = 'NOT EXISTS ('.
 				'SELECT NULL'.
 				' FROM functions f1'.
-				' JOIN items i1 ON f1.itemid=i1.itemid'.
+				' JOIN items i1 ON f1.itemid=i1.itemid and f1.itemid!=i.itemid'.
 				' JOIN host_hgset hh1 ON i1.hostid=hh1.hostid'.
 				' LEFT JOIN permission p1 ON hh1.hgsetid=p1.hgsetid'.
 					' AND p1.ugsetid=p.ugsetid'.
-				' WHERE t.triggerid=f1.triggerid'.
-					' AND p1.permission IS NULL'.
+				' WHERE f.triggerid=f1.triggerid'.
+					' AND p1.hgsetid IS NULL'.
 			')';
 		}
 
diff --git a/ui/include/classes/api/services/CTriggerPrototype.php b/ui/include/classes/api/services/CTriggerPrototype.php
index c27ebefd067..f87371f94a0 100644
--- a/ui/include/classes/api/services/CTriggerPrototype.php
+++ b/ui/include/classes/api/services/CTriggerPrototype.php
@@ -123,12 +123,12 @@ class CTriggerPrototype extends CTriggerGeneral {
 			$sqlParts['where'][] = 'NOT EXISTS ('.
 				'SELECT NULL'.
 				' FROM functions f1'.
-				' JOIN items i1 ON f1.itemid=i1.itemid'.
+				' JOIN items i1 ON f1.itemid=i1.itemid and f1.itemid!=i.itemid'.
 				' JOIN host_hgset hh1 ON i1.hostid=hh1.hostid'.
 				' LEFT JOIN permission p1 ON hh1.hgsetid=p1.hgsetid'.
 					' AND p1.ugsetid=p.ugsetid'.
-				' WHERE t.triggerid=f1.triggerid'.
-					' AND p1.permission IS NULL'.
+				' WHERE f.triggerid=f1.triggerid'.
+					' AND p1.hgsetid IS NULL'.
 			')';
 		}
 
