From: Ben Pfaff <[email protected]>

This should avoid some work by doing the cheapest check (the one on
UseLogicalDatapathGroups) before any joins.  DDlog is probably
factoring out the reference to the Flow relation, which is identical
in both, but this ought to avoid the group_by aggregation (which is
relatively expensive) in the case where UseLogicalDatapathGroups is
not enabled.

Signed-off-by: Ben Pfaff <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
---
 northd/ovn_northd.dl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/northd/ovn_northd.dl b/northd/ovn_northd.dl
index ceeabe6f3..46280e22e 100644
--- a/northd/ovn_northd.dl
+++ b/northd/ovn_northd.dl
@@ -1659,17 +1659,17 @@ AggregatedFlow(.logical_datapaths = g.to_set(),
                .__match = __match,
                .actions = actions,
                .external_ids = external_ids) :-
+    UseLogicalDatapathGroups[true],
     Flow(logical_datapath, stage, priority, __match, actions, external_ids),
-    var g = logical_datapath.group_by((stage, priority, __match, actions, 
external_ids)),
-    UseLogicalDatapathGroups[true].
+    var g = logical_datapath.group_by((stage, priority, __match, actions, 
external_ids)).
 AggregatedFlow(.logical_datapaths = set_singleton(logical_datapath),
                .stage = stage,
                .priority = priority,
                .__match = __match,
                .actions = actions,
                .external_ids = external_ids) :-
-    Flow(logical_datapath, stage, priority, __match, actions, external_ids),
-    UseLogicalDatapathGroups[false].
+    UseLogicalDatapathGroups[false],
+    Flow(logical_datapath, stage, priority, __match, actions, external_ids).
 
 for (f in AggregatedFlow()) {
     var pipeline = if (f.stage.pipeline == Ingress) "ingress" else "egress" in
-- 
2.31.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to