Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit160b606

Browse files
committed
Update dtmbench to support pathman
1 parent090c832 commit160b606

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎contrib/postgres_fdw/tests/dtmbench.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,19 @@ void* writer(void* arg)
156156
voidinitializeDatabase()
157157
{
158158
connectionconn(cfg.connection);
159-
int accountsPerShard = (cfg.nAccounts + cfg.nShards -1)/cfg.nShards;
160-
for (int i =0; i < cfg.nShards; i++)
161-
{
159+
if (cfg.nShards ==0) {
162160
worktxn(conn);
163-
exec(txn,"alter table t_fdw%i add check (u between %d and %d)", i+1, accountsPerShard*i, accountsPerShard*(i+1)-1);
164-
exec(txn,"insert into t_fdw%i (select generate_series(%d,%d), %d)", i+1, accountsPerShard*i, accountsPerShard*(i+1)-1,0);
161+
exec(txn,"insert into t (select generate_series(1,%d), 0)", cfg.nAccounts);
165162
txn.commit();
163+
}else {
164+
int accountsPerShard = (cfg.nAccounts + cfg.nShards -1)/cfg.nShards;
165+
for (int i =0; i < cfg.nShards; i++)
166+
{
167+
worktxn(conn);
168+
exec(txn,"alter table t_fdw%i add check (u between %d and %d)", i+1, accountsPerShard*i, accountsPerShard*(i+1)-1);
169+
exec(txn,"insert into t_fdw%i (select generate_series(%d,%d), %d)", i+1, accountsPerShard*i, accountsPerShard*(i+1)-1,0);
170+
txn.commit();
171+
}
166172
}
167173
}
168174

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp