Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8c14bbb

Browse files
committed
Partitioning only accounts table.
1 parent 3445f4d commit 8c14bbb

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

devops/pgbench_prepare.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,20 @@
2020
tags:
2121
- pgbench_history
2222

23+
- name: initialize pgbench everywhere to avoid count(*) failure, scale {{ scale }}
24+
command: >
25+
pgbench -p {{ pg_port }} -s {{ scale }} -i
26+
tags:
27+
- pgbench_init
28+
29+
2330
- hosts: init_node
2431
vars:
2532
scale: 10
2633
nparts: 10
2734
repfactor: 0
2835
rebalance: true
36+
tellers_branches: true
2937
environment:
3038
PATH: "{{ pg_dst }}/bin:{{ ansible_env.PATH }}"
3139

@@ -57,27 +65,26 @@
5765
tags:
5866
- pgbench_init
5967

60-
- name: create_hash_partitions, nparts {{ nparts }}
68+
- name: create_hash_partitions for pgbench_accounts, nparts {{ nparts }}
6169
command: >
6270
psql -p {{ pg_port }} -c "
6371
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_accounts', 'aid', {{ nparts }}, {{ rebalance }});
64-
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_tellers', 'tid', {{ nparts }}, {{ rebalance }});
65-
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_branches', 'bid', {{ nparts }}, {{ rebalance }});
72+
select shardman.set_replevel('pgbench_accounts', {{ repfactor }});
6673
"
6774
tags:
68-
- create_hash_partitions
75+
- create_hash_partitions_accounts
6976

70-
- name: set_repfactor, repfactor {{ repfactor }}
77+
- name: create_hash_partitions for branches & tellers, nparts {{ nparts }}
7178
command: >
7279
psql -p {{ pg_port }} -c "
73-
select shardman.set_replevel('pgbench_accounts', {{ repfactor }});
80+
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_tellers', 'tid', {{ nparts }}, {{ rebalance }});
81+
select shardman.create_hash_partitions({{ my_id.stdout }}, 'pgbench_branches', 'bid', {{ nparts }}, {{ rebalance }});
7482
select shardman.set_replevel('pgbench_tellers', {{ repfactor }});
7583
select shardman.set_replevel('pgbench_branches', {{ repfactor }});
7684
"
7785
tags:
78-
- set_repfactor
79-
when: repfactor != 0
80-
86+
- create_hash_partitions_tellers_branches
87+
when: tellers_branches | bool
8188

8289
- hosts: shardlord
8390
environment:

0 commit comments

Comments
 (0)