-
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.
62617: sql, server: add SQLStatsResetter to distsql and internalExecutor r=asubiotto,yuzefovich a=Azhng Closes #62587. Release note: None Co-authored-by: Azhng <[email protected]>
- Loading branch information
Showing
5 changed files
with
62 additions
and
0 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
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
48 changes: 48 additions & 0 deletions
48
pkg/sql/logictest/testdata/logic_test/distsql_crdb_internal
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,48 @@ | ||
# LogicTest: 5node-default-configs | ||
|
||
statement ok | ||
CREATE TABLE data (a INT, b INT, c FLOAT, d DECIMAL, PRIMARY KEY (a, b, c, d)) | ||
|
||
# Split into ten parts. | ||
statement ok | ||
ALTER TABLE data SPLIT AT SELECT i FROM generate_series(1, 9) AS g(i) | ||
|
||
# Relocate the ten parts to the five nodes. | ||
statement ok | ||
ALTER TABLE data EXPERIMENTAL_RELOCATE | ||
SELECT ARRAY[i%5+1], i FROM generate_series(0, 9) AS g(i) | ||
|
||
# Generate all combinations of values 1 to 10. | ||
statement ok | ||
INSERT INTO data SELECT a, b, c::FLOAT, d::DECIMAL FROM | ||
generate_series(1, 10) AS a(a), | ||
generate_series(1, 10) AS b(b), | ||
generate_series(1, 10) AS c(c), | ||
generate_series(1, 10) AS d(d) | ||
|
||
# Verify data placement. | ||
query TTTI colnames,rowsort | ||
SELECT start_key, end_key, replicas, lease_holder FROM [SHOW RANGES FROM TABLE data] | ||
---- | ||
start_key end_key replicas lease_holder | ||
NULL /1 {1} 1 | ||
/1 /2 {2} 2 | ||
/2 /3 {3} 3 | ||
/3 /4 {4} 4 | ||
/4 /5 {5} 5 | ||
/5 /6 {1} 1 | ||
/6 /7 {2} 2 | ||
/7 /8 {3} 3 | ||
/8 /9 {4} 4 | ||
/9 NULL {5} 5 | ||
|
||
|
||
query II | ||
SELECT a, count(*) AS cnt FROM data GROUP BY a HAVING crdb_internal.reset_sql_stats() ORDER BY a LIMIT 5 | ||
---- | ||
1 1000 | ||
2 1000 | ||
3 1000 | ||
4 1000 | ||
5 1000 | ||
|
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