Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-24.1: sql: implement generic query plans #128085

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,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 @@ -866,6 +866,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 @@ -1880,6 +1881,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
13 changes: 13 additions & 0 deletions pkg/ccl/gqpccl/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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",
],
)
23 changes: 23 additions & 0 deletions pkg/ccl/gqpccl/gpq.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// 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"
)

func init() {
gpq.CheckClusterSupportsGenericQueryPlans = checkClusterSupportsGenericQueryPlans
}

func checkClusterSupportsGenericQueryPlans(settings *cluster.Settings) error {
return utilccl.CheckEnterpriseEnabled(settings, "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 @@ -143,6 +143,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 @@ -164,6 +165,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