-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: Introduce SQL-level split command #8860
Description
The cockroach debug range split command was introduced (originally as a non-debug command) to allow sophisticated admins to pre-split the keyspace in preparation for anticipated load. (In my experience this manual work proved crucial for smooth launches of bigtable-based applications). Now that all applications use SQL instead of raw KV access, it is difficult for an admin to construct the keys that are necessary to use this command. We should introduce some way to manually split a table at a key given in terms of a sql table and values for its PK columns. This could either be a statement or function used via a normal SQL connection or a dedicated CLI command like cockroach debug range split.
In addition to use by administrators, such a command could also be used in jepsen tests to stress-test consistency in the presence of splits.