-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: refactor InternalExecutor on EvalCtx
Minor refactor to remove duplicate InternalExecutor definition on EvalCtx and in the tree package. We already have 2 interface declarations for InternalExecutor in sql and sqlutil, this refactor hopefully makes the dependencies a little more clear. For builtins, we now use an InternalExecutorFactory where we must pass in the txn, session data and desc.Collections to use the IE. Release note: None
- Loading branch information
1 parent
7d2431d
commit f891b79
Showing
22 changed files
with
191 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
package rttanalysis | ||
|
||
import "testing" | ||
|
||
func BenchmarkInternalExecutor(b *testing.B) { | ||
tests := []RoundTripBenchTestCase{ | ||
{ | ||
Name: "has_schema_privilege_1_col", | ||
Setup: `CREATE SCHEMA s;`, | ||
Stmt: `SELECT has_schema_privilege('s', 'CREATE')`, | ||
}, | ||
{ | ||
Name: "has_schema_privilege_2_col", | ||
Setup: `CREATE SCHEMA s;`, | ||
Stmt: `SELECT has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE')`, | ||
}, | ||
{ | ||
Name: "has_schema_privilege_3_col", | ||
Setup: `CREATE SCHEMA s;`, | ||
Stmt: `SELECT has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE')`, | ||
}, | ||
{ | ||
Name: "has_schema_privilege_3_schemas_3_col", | ||
Setup: `CREATE SCHEMA s; CREATE SCHEMA s2; CREATE SCHEMA s3;`, | ||
Stmt: `SELECT has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE')`, | ||
}, | ||
{ | ||
Name: "has_schema_privilege_5_schemas_3_col", | ||
Setup: `CREATE SCHEMA s; CREATE SCHEMA s2; CREATE SCHEMA s3; CREATE SCHEMA s4; CREATE SCHEMA s5;`, | ||
Stmt: `SELECT has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE'), has_schema_privilege('s', 'CREATE')`, | ||
}, | ||
} | ||
|
||
RunRoundTripBenchmark(b, tests) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.