Skip to content

Commit

Permalink
Merge pull request #128100 from mgartner/backport23.2-125708-125795-1…
Browse files Browse the repository at this point in the history
…25808-125871-126528-126863-125814-127214-127897

release-23.2: implement generic query plans
  • Loading branch information
mgartner authored Sep 5, 2024
2 parents 0588fa3 + 8e980f3 commit ee2bd8b
Show file tree
Hide file tree
Showing 62 changed files with 3,537 additions and 232 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@
#!/pkg/ccl/cliccl/ @cockroachdb/unowned
/pkg/ccl/cmdccl/stub-schema-registry/ @cockroachdb/cdc-prs
/pkg/ccl/cmdccl/clusterrepl/ @cockroachdb/disaster-recovery
/pkg/ccl/gqpccl/ @cockroachdb/sql-queries-prs
#!/pkg/ccl/gssapiccl/ @cockroachdb/unowned
/pkg/ccl/jwtauthccl/ @cockroachdb/cloud-identity
#!/pkg/ccl/kvccl/ @cockroachdb/kv-noreview
Expand Down
2 changes: 2 additions & 0 deletions pkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ GO_TARGETS = [
"//pkg/ccl/cmdccl/clusterrepl:clusterrepl_lib",
"//pkg/ccl/cmdccl/stub-schema-registry:stub-schema-registry",
"//pkg/ccl/cmdccl/stub-schema-registry:stub-schema-registry_lib",
"//pkg/ccl/gqpccl:gqpccl",
"//pkg/ccl/gssapiccl:gssapiccl",
"//pkg/ccl/importerccl:importerccl_test",
"//pkg/ccl/jobsccl/jobsprotectedtsccl:jobsprotectedtsccl_test",
Expand Down Expand Up @@ -1836,6 +1837,7 @@ GO_TARGETS = [
"//pkg/sql/gcjob:gcjob",
"//pkg/sql/gcjob:gcjob_test",
"//pkg/sql/gcjob_test:gcjob_test_test",
"//pkg/sql/gpq:gpq",
"//pkg/sql/idxrecommendations:idxrecommendations",
"//pkg/sql/idxrecommendations:idxrecommendations_test",
"//pkg/sql/idxusage:idxusage",
Expand Down
1 change: 1 addition & 0 deletions pkg/ccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ go_library(
"//pkg/ccl/buildccl",
"//pkg/ccl/changefeedccl",
"//pkg/ccl/cliccl",
"//pkg/ccl/gqpccl",
"//pkg/ccl/gssapiccl",
"//pkg/ccl/jwtauthccl",
"//pkg/ccl/kvccl",
Expand Down
1 change: 1 addition & 0 deletions pkg/ccl/ccl_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
_ "github.com/cockroachdb/cockroach/pkg/ccl/buildccl"
_ "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl"
_ "github.com/cockroachdb/cockroach/pkg/ccl/cliccl"
_ "github.com/cockroachdb/cockroach/pkg/ccl/gqpccl"
_ "github.com/cockroachdb/cockroach/pkg/ccl/gssapiccl"
_ "github.com/cockroachdb/cockroach/pkg/ccl/jwtauthccl"
_ "github.com/cockroachdb/cockroach/pkg/ccl/kvccl"
Expand Down
14 changes: 14 additions & 0 deletions pkg/ccl/gqpccl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "gqpccl",
srcs = ["gpq.go"],
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/gqpccl",
visibility = ["//visibility:public"],
deps = [
"//pkg/ccl/utilccl",
"//pkg/settings/cluster",
"//pkg/sql/gpq",
"//pkg/util/uuid",
],
)
24 changes: 24 additions & 0 deletions pkg/ccl/gqpccl/gpq.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2024 The Cockroach Authors.
//
// Licensed as a CockroachDB Enterprise file under the Cockroach Community
// License (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt

package gpqccl

import (
"github.com/cockroachdb/cockroach/pkg/ccl/utilccl"
"github.com/cockroachdb/cockroach/pkg/settings/cluster"
"github.com/cockroachdb/cockroach/pkg/sql/gpq"
"github.com/cockroachdb/cockroach/pkg/util/uuid"
)

func init() {
gpq.CheckClusterSupportsGenericQueryPlans = checkClusterSupportsGenericQueryPlans
}

func checkClusterSupportsGenericQueryPlans(settings *cluster.Settings, cluster uuid.UUID) error {
return utilccl.CheckEnterpriseEnabled(settings, cluster, "generic query plans")
}
2 changes: 2 additions & 0 deletions pkg/ccl/logictestccl/testdata/logic_test/explain_call_plpgsql
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ planning time: 10µs
execution time: 100µs
distribution: <hidden>
vectorized: <hidden>
plan type: custom
maximum memory usage: <hidden>
network usage: <hidden>
regions: <hidden>
Expand All @@ -158,6 +159,7 @@ planning time: 10µs
execution time: 100µs
distribution: <hidden>
vectorized: <hidden>
plan type: custom
maximum memory usage: <hidden>
network usage: <hidden>
regions: <hidden>
Expand Down
Loading

0 comments on commit ee2bd8b

Please sign in to comment.