func constructJoinPlan(ctx *sql.Context, a *Analyzer, n sql.Node, scope *Scope) (sql.Node, error) {
	span, ctx := ctx.Span("construct_join_plan")
	defer span.Finish()
	if !n.Resolved() {
		return n, nil
	}
	if plan.IsNoRowNode(n) {
		return n, nil
	}
	return replaceJoinPlans(ctx, a, n, scope)
}
constructJoinPlan finds an optimal table ordering and access plan for the tables in the query.
package analyzer
import (
	"fmt"
	"reflect"
	"regexp"
	"strings"
	"github.com/dolthub/go-mysql-server/sql"
	"github.com/dolthub/go-mysql-server/sql/expression"
	"github.com/dolthub/go-mysql-server/sql/plan"
)