-
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.
Merge pull request #41420 from jordanlewis/backport19.2-41324
release-19.2: sql,opt: re-enable 1pc for small delRange ops
- Loading branch information
Showing
6 changed files
with
166 additions
and
48 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
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,38 @@ | ||
# LogicTest: local | ||
|
||
statement ok | ||
CREATE TABLE a (a INT PRIMARY KEY) | ||
|
||
# Delete range operates in chunks of 600 (defined by sql.TableTruncateChunkSize). | ||
statement ok | ||
INSERT INTO a SELECT * FROM generate_series(1,1000) | ||
|
||
statement ok | ||
SET tracing = on,kv; DELETE FROM a; SET tracing = off | ||
|
||
# Ensure that DelRange requests are chunked for DELETE FROM... | ||
query TT | ||
SELECT operation, message FROM [SHOW KV TRACE FOR SESSION] | ||
WHERE message LIKE '%DelRange%' OR message LIKE '%sending batch%' | ||
---- | ||
flow DelRange /Table/53/1 - /Table/53/2 | ||
dist sender send r24: sending batch 1 DelRng to (n1,s1):1 | ||
flow DelRange /Table/53/1/601/0 - /Table/53/2 | ||
dist sender send r24: sending batch 1 DelRng to (n1,s1):1 | ||
dist sender send r24: sending batch 1 EndTxn to (n1,s1):1 | ||
|
||
# Ensure that DelRange requests are autocommitted when DELETE FROM happens on a | ||
# chunk of fewer than 600 keys. | ||
|
||
statement ok | ||
INSERT INTO a VALUES(5) | ||
|
||
statement ok | ||
SET tracing = on,kv; DELETE FROM a WHERE a = 5; SET tracing = off | ||
|
||
query TT | ||
SELECT operation, message FROM [SHOW KV TRACE FOR SESSION] | ||
WHERE message LIKE '%DelRange%' OR message LIKE '%sending batch%' | ||
---- | ||
flow DelRange /Table/53/1/5 - /Table/53/1/5/# | ||
dist sender send r24: sending batch 1 DelRng, 1 EndTxn to (n1,s1):1 |
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