-
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.
67720: sql: rationalize batch key and bytes limit r=andreimatei a=andreimatei Before this patch, the txnKVFetcher had two modes of operation: either use both key limits and bytes limits, or use neither. This patch changes it to the following three modes: only bytes limits, both, neither - thus adding the only bytes limits mode. The idea is that, frequently, only bytes limits are desired - getting row limits in those cases was a historical artifact. The choices for the user of the fetcher are the following: 1) I want DistSender-level parallelism. I can't use any limits. 2) I want to read some key spans fully. But I don't want to OOM either myself (the client) or the server. In this case I want only memory limits (and I was getting row limits before this patch for no reason). 3) I hope I won't have to read my spans fully. The high-level query has a LIMIT, which has been processed into a fetcher-level hint about how many keys need to be read to satisfy the LIMIT. Even if that hint proves too small, there's still likely a point where enough rows will have been read. In this case, I start with my hint, and then (while insufficient), I progressively ratched it up. All the batches have bytes limits too since I don't want OOMs and, since I use key limits, DistSender-parallelism is inhibited anyway (so there's no reason not to use bytes limit). For case 3), there's still an upper-bound key limit to the "ratcheting up" behavior. This is productionKVBatchSize - which this patch increases from 10k keys to 100k. I'm not sure if the existence of this upper bound is rational; I'm thinking that it acts as an upper-bound on the amount of wasted work due to over-shooting the real LIMIT. Since the bytes limit is 10MB, it doesn't matter very much. The fetcher clients that don't specify a "firstBatchRowHint" used to get the bytes limit and a key limit of 10k. Now they get only the bytes limit. This category includes the joinReader, the inverted joiner, some backfills, and some DELETEs. For the fetcher client that specify a hint, the behavior is unchanged with the exception of the fact that the upper bound of the key limit ratcheting is now 100k instead of 10k. This means that, for rows under 1KB, they're now more likely to hit the memory limit then the key limit. This category includes the cFetcher, the TableReader, and the zig-zag joiner. Release note: None 68606: sql: support COMMENT ON SCHEMA r=otan a=ekalinin Fixes #67689 This change adds support for SCHEMA comment. Release note (sql change): This change adds associating comment to SQL schema using PostgreSQL's `COMMENT ON SCHEMA` syntax. 68892: backupccl: move SHOW BACKUP manifest loading to helper r=dt a=dt This pulls the manifest loading and rendering step of SHOW BACKUP into a helper, behind an interface, that can then allow for other implementations of the interface that load backup information differently, much like how the actual renderer was already plugable. Release note: none. Co-authored-by: Andrei Matei <andrei@cockroachlabs.com> Co-authored-by: Eugene Kalinin <e.v.kalinin@gmail.com> Co-authored-by: David Taylor <tinystatemachine@gmail.com>
- Loading branch information
Showing
56 changed files
with
995 additions
and
556 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
comment_stmt ::= | ||
'COMMENT' 'ON' 'DATABASE' database_name 'IS' comment_text | ||
| 'COMMENT' 'ON' 'SCHEMA' schema_name 'IS' comment_text | ||
| 'COMMENT' 'ON' 'TABLE' table_name 'IS' comment_text | ||
| 'COMMENT' 'ON' 'COLUMN' column_name 'IS' comment_text | ||
| 'COMMENT' 'ON' 'INDEX' table_index_name 'IS' comment_text |
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.