db.go
func (db *DB) KeySplits(prefix []byte) []string {
	var splits []string
	for _, ti := range db.Tables() {
		// We don't use ti.Left, because that has a tendency to store !badger
		// keys.
		if bytes.HasPrefix(ti.Right, prefix) {
			splits = append(splits, string(ti.Right))
		}
	}
	sort.Strings(splits)
	return splits
}
func (db *DB) KeySplits(prefix []byte) []string {
	var splits []string
	for _, ti := range db.Tables() {
		// We don't use ti.Left, because that has a tendency to store !badger
		// keys.
		if bytes.HasPrefix(ti.Right, prefix) {
			splits = append(splits, string(ti.Right))
		}
	}
	sort.Strings(splits)
	return splits
}
// KeySplits can be used to get rough key ranges to divide up iteration over
// the DB.