Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
Signed-off-by: arenatlx <314806019@qq.com>
  • Loading branch information
AilinKid committed Nov 11, 2024
1 parent cec48bb commit 2be8f82
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/planner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go_library(
"//pkg/metrics",
"//pkg/parser/ast",
"//pkg/parser/model",
"//pkg/planner/cascades",
"//pkg/planner/cascades/old",
"//pkg/planner/core",
"//pkg/planner/core/base",
"//pkg/planner/core/resolve",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "cascades",
name = "old",
srcs = [
"enforcer_rules.go",
"implementation_rules.go",
"optimize.go",
"stringer.go",
"transformation_rules.go",
],
importpath = "github.com/pingcap/tidb/pkg/planner/cascades",
importpath = "github.com/pingcap/tidb/pkg/planner/cascades/old",
visibility = ["//visibility:public"],
deps = [
"//pkg/expression",
Expand Down Expand Up @@ -37,7 +37,7 @@ go_library(
)

go_test(
name = "cascades_test",
name = "old_test",
timeout = "short",
srcs = [
"enforcer_rules_test.go",
Expand All @@ -46,8 +46,7 @@ go_test(
"stringer_test.go",
"transformation_rules_test.go",
],
data = glob(["testdata/**"]),
embed = [":cascades"],
embed = [":old"],
flaky = True,
shard_count = 25,
deps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"math"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"math"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"flag"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"container/list"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"bytes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"math"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package cascades
package old

import (
"context"
Expand Down
4 changes: 2 additions & 2 deletions pkg/planner/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/pingcap/tidb/pkg/metrics"
"github.com/pingcap/tidb/pkg/parser/ast"
"github.com/pingcap/tidb/pkg/parser/model"
"github.com/pingcap/tidb/pkg/planner/cascades"
"github.com/pingcap/tidb/pkg/planner/cascades/old"
"github.com/pingcap/tidb/pkg/planner/core"
"github.com/pingcap/tidb/pkg/planner/core/base"
"github.com/pingcap/tidb/pkg/planner/core/resolve"
Expand Down Expand Up @@ -521,7 +521,7 @@ func optimize(ctx context.Context, sctx planctx.PlanContext, node *resolve.NodeW

// Handle the logical plan statement, use cascades planner if enabled.
if sessVars.GetEnableCascadesPlanner() {
finalPlan, cost, err := cascades.DefaultOptimizer.FindBestPlan(sctx, logic)
finalPlan, cost, err := old.DefaultOptimizer.FindBestPlan(sctx, logic)
return finalPlan, names, cost, err
}

Expand Down

0 comments on commit 2be8f82

Please sign in to comment.