Skip to content

Commit 3484131

Browse files
committed
Update examples to be a little more interesting
... using a local cluster started with: ``` cockroach demo --global --nodes=9 ```
1 parent 8502150 commit 3484131

File tree

2 files changed

+41
-23
lines changed

2 files changed

+41
-23
lines changed

src/current/v25.2/alter-index.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,31 +374,49 @@ Before scattering, you can view the current leaseholder distribution for an inde
374374

375375
{% include_cached copy-clipboard.html %}
376376
~~~ sql
377-
WITH range_details AS (SHOW RANGES FROM DATABASE movr WITH DETAILS) SELECT range_id, lease_holder, replicas from range_details;
377+
WITH range_details AS (SHOW RANGES FROM index rides@rides_pkey WITH DETAILS) SELECT range_id, lease_holder, replicas from range_details;
378378
~~~
379379

380380
~~~
381381
range_id | lease_holder | replicas
382382
-----------+--------------+-----------
383-
94 | 1 | {1}
383+
135 | 9 | {2,6,9}
384+
123 | 6 | {2,6,9}
385+
122 | 9 | {2,6,9}
386+
120 | 9 | {3,6,9}
387+
121 | 9 | {3,6,9}
388+
119 | 6 | {2,6,9}
389+
93 | 6 | {1,6,9}
390+
91 | 2 | {2,6,9}
391+
92 | 6 | {2,6,8}
392+
(9 rows)
384393
~~~
385394

386395
{% include_cached copy-clipboard.html %}
387396
~~~ sql
388-
> ALTER INDEX rides@revenue_idx SCATTER;
397+
ALTER INDEX rides@rides_pkey SCATTER;
389398
~~~
390399

391400
After scattering, recheck the leaseholder distribution:
392401

393402
{% include_cached copy-clipboard.html %}
394403
~~~ sql
395-
WITH range_details AS (SHOW RANGES FROM DATABASE movr WITH DETAILS) SELECT range_id, lease_holder, replicas from range_details;
404+
WITH range_details AS (SHOW RANGES FROM index rides@rides_pkey WITH DETAILS) SELECT range_id, lease_holder, replicas from range_details;
396405
~~~
397406

398407
~~~
399408
range_id | lease_holder | replicas
400409
-----------+--------------+-----------
401-
94 | 1 | {1}
410+
135 | 9 | {1,6,9}
411+
123 | 5 | {2,5,9}
412+
122 | 5 | {2,5,9}
413+
120 | 6 | {3,6,9}
414+
121 | 3 | {3,6,9}
415+
119 | 5 | {3,5,9}
416+
93 | 5 | {1,5,9}
417+
91 | 1 | {1,5,9}
418+
92 | 5 | {2,5,8}
419+
(9 rows)
402420
~~~
403421

404422
### Split and unsplit indexes

src/current/v25.2/alter-table.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,15 +2864,15 @@ WITH range_details AS (SHOW RANGES FROM TABLE movr.users WITH DETAILS) SELECT ra
28642864
~~~
28652865
range_id | lease_holder | replicas
28662866
-----------+--------------+-----------
2867-
99 | 1 | {1}
2868-
82 | 1 | {1}
2869-
81 | 1 | {1}
2870-
77 | 1 | {1}
2871-
80 | 1 | {1}
2872-
75 | 1 | {1}
2873-
79 | 1 | {1}
2874-
76 | 1 | {1}
2875-
78 | 1 | {1}
2867+
94 | 2 | {2,5,9}
2868+
78 | 3 | {3,5,9}
2869+
77 | 2 | {2,4,9}
2870+
76 | 3 | {3,6,9}
2871+
95 | 3 | {3,5,9}
2872+
75 | 2 | {2,5,8}
2873+
87 | 4 | {2,4,7}
2874+
85 | 2 | {2,5,9}
2875+
86 | 7 | {3,4,7}
28762876
(9 rows)
28772877
~~~
28782878
@@ -2891,15 +2891,15 @@ WITH range_details AS (SHOW RANGES FROM TABLE movr.users WITH DETAILS) SELECT ra
28912891
~~~
28922892
range_id | lease_holder | replicas
28932893
-----------+--------------+-----------
2894-
99 | 1 | {1}
2895-
82 | 1 | {1}
2896-
81 | 1 | {1}
2897-
77 | 1 | {1}
2898-
80 | 1 | {1}
2899-
75 | 1 | {1}
2900-
79 | 1 | {1}
2901-
76 | 1 | {1}
2902-
78 | 1 | {1}
2894+
94 | 5 | {2,5,8}
2895+
78 | 1 | {1,5,9}
2896+
77 | 1 | {1,4,9}
2897+
76 | 1 | {1,6,9}
2898+
95 | 1 | {1,5,9}
2899+
75 | 1 | {1,5,8}
2900+
87 | 7 | {2,4,7}
2901+
85 | 1 | {1,5,9}
2902+
86 | 3 | {3,4,7}
29032903
(9 rows)
29042904
~~~
29052905

0 commit comments

Comments
 (0)