From 93bbbe7df54143f19179d926040af48a18ace2d3 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Mon, 6 Jan 2025 15:55:02 +0530 Subject: [PATCH] added comments Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/operators/join_merging.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/vt/vtgate/planbuilder/operators/join_merging.go b/go/vt/vtgate/planbuilder/operators/join_merging.go index 707f41d6f51..cb3569cf79e 100644 --- a/go/vt/vtgate/planbuilder/operators/join_merging.go +++ b/go/vt/vtgate/planbuilder/operators/join_merging.go @@ -171,6 +171,8 @@ func getRoutesOrAlternates(ctx *plancontext.PlanningContext, lhsRoute, rhsRoute return lhsRoute, rhsRoute, routingA, routingB, sameKeyspace } + // If we have a reference route, we will try to find an alternate route in same keyspace as other routing keyspace. + // If the reference route is part of DML table update target, alternate keyspace route cannot be considered. if refA, ok := routingA.(*AnyShardRouting); ok && !TableID(lhsRoute).IsOverlapping(ctx.SemTable.DMLTargets) { if altARoute := refA.AlternateInKeyspace(routingB.Keyspace()); altARoute != nil {