You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bin/insbench/insbench.cpp
+40-7Lines changed: 40 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -41,11 +41,13 @@ struct config
41
41
int nIndexes;
42
42
int nIterations;
43
43
int transactionSize;
44
+
int initialSize;
44
45
bool useSystemTime;
45
46
bool noPK;
46
47
string connection;
47
48
48
49
config() {
50
+
initialSize = 1000000;
49
51
indexUpdateInterval = 0;
50
52
nInserters = 1;
51
53
nIndexes = 8;
@@ -96,7 +98,8 @@ void* inserter(void* arg)
96
98
} else {
97
99
con.prepare("insert", "insert into t (select generate_series($1::integer,$2::integer),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000))");
exec(txn, "create index idx%d on t(k%d) where pk<%ld", i, i+1, 0);
160
164
}
161
165
}
166
+
167
+
if (cfg.initialSize)
168
+
{
169
+
if (cfg.useSystemTime)
170
+
{
171
+
#if PQXX_VERSION_MAJOR >= 4
172
+
con.prepare("insert", "insert into t values ($1,$2,$3,$4,$5,$6,$7,$8,$9)");
173
+
#else
174
+
con.prepare("insert", "insert into t values ($1,$2,$3,$4,$5,$6,$7,$8,$9)")("bigint")("bigint")("bigint")("bigint")("bigint")("bigint")("bigint")("bigint")("bigint");
175
+
#endif
176
+
} else {
177
+
con.prepare("insert", "insert into t (select generate_series($1::integer,$2::integer),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000),ceil(random()*1000000000))");
0 commit comments