-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpleaseholder.sql
43 lines (35 loc) · 1.33 KB
/
gpleaseholder.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- Geopartitioned leaseholder
use tpcc;
show create customer;
alter table public.customer partition by range (c_w_id) (
PARTITION apnw values from (MINVALUE) to (15),
PARTITION euwest values from (15) to (30),
PARTITION uswest values from (30) to (60),
PARTITION useast values from (60) to (MAXVALUE)
);
alter index public.customer@customer_idx partition by range (c_w_id) (
PARTITION apnw values from (MINVALUE) to (15),
PARTITION euwest values from (15) to (30),
PARTITION uswest values from (30) to (60),
PARTITION useast values from (60) to (MAXVALUE)
);
alter partition apnw of index customer@*
configure zone using
num_replicas =5,
constraints = '{"+region=ap-northeast-2":1}',
lease_preferences = '[[+region=ap-northeast-2]]';
alter partition uswest of index customer@*
configure zone using
num_replicas =5,
constraints = '{"+region=us-west-2":1}',
lease_preferences = '[[+region=us-west-2]]';
alter partition useast of index customer@*
configure zone using
num_replicas =5,
constraints = '{"+region=us-east-2":1}',
lease_preferences = '[[+region=us-east-2]]';
alter partition euwest of index customer@*
configure zone using
num_replicas =5,
constraints = '{"+region=eu-west-2":1}',
lease_preferences = '[[+region=eu-west-2]]';