Split API (beyond size-based splits)

Curious if there is an API for creating manual splits in a keyspace for bulk loading or for dealing with hot spots?

Is there documentation on what how a table insert is encoded in rocksdb for the purpose of computing ideal split points?

Is there a way to dump the splits of a database or raft group?

You can manually split tables with the (not yet documented) command ALTER TABLE foo SPLIT AT (primary_key_value).

The details of the key encoding is not documented, but you shouldn’t need to know it to compute appropriate split keys. Just choose primary key values from the same distribution as your real primary keys (so if they’re UUIDs, choose either random UUIDs or equally-spaced values throughout the uuid space…)

I don’t think we currently have a good way to inspect the split points. You can dump all the split points of the database (but not in a user-friendly format) with cockroach debug range ls.