Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
ea21eea6
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ea21eea6
编写于
9月 13, 2006
作者:
T
Tatsuo Ishii
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change "tps" to "scale" to avoid confusion
Fix bug with handling default scaling factor in the default scenarios
上级
500da222
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
56 addition
and
36 deletion
+56
-36
contrib/pgbench/README.pgbench
contrib/pgbench/README.pgbench
+10
-4
contrib/pgbench/README.pgbench_jis
contrib/pgbench/README.pgbench_jis
+9
-5
contrib/pgbench/pgbench.c
contrib/pgbench/pgbench.c
+37
-27
未找到文件。
contrib/pgbench/README.pgbench
浏览文件 @
ea21eea6
...
...
@@ -184,7 +184,7 @@ o -f option
example:
\set ntellers 10 * :
tps
\set ntellers 10 * :
scale
\setrandom name min max
...
...
@@ -206,9 +206,9 @@ o -f option
Example, TPC-B like benchmark can be defined as follows(scaling
factor = 1):
\set nbranches :
tps
\set ntellers 10 * :
tps
\set naccounts 100000 * :
tps
\set nbranches :
scale
\set ntellers 10 * :
scale
\set naccounts 100000 * :
scale
\setrandom aid 1 :naccounts
\setrandom bid 1 :nbranches
\setrandom tid 1 :ntellers
...
...
@@ -235,6 +235,12 @@ Basically it is same as BSD license. See pgbench.c for more details.
o History
2006/09/14
* change "tps" to "scale" to avoid confusion
* fix bug with handling default scaling factor in the default
scenarios
2006/07/26
* New features contributed by Tomoaki Sato.
...
...
contrib/pgbench/README.pgbench_jis
浏览文件 @
ea21eea6
...
...
@@ -73,7 +73,7 @@ pgbench $B$K$O$$$m$$$m$J%*%W%7%g%s$,$"$j$^$9!%(B
$BBg$-$5$,(B 10$BK|(B x [$B%9%1!<%j%s%0%U%!%/%?!<(B]$B$K$J$j$^$9!%(B
$B%G%U%)%k%H$N%9%1!<%j%s%0%U%!%/%?!<$O(B 1 $B$G$9!%(B
-f $B%*%W%7%g%s$G;XDj$7$?%U%!%$%k$+$i%9%1!<%j%s%0%U%!%/(B
$B%?!<$r;2>H$9$k$K$O(B
tps
$B$H$$$&JQ?tL>$r;HMQ$7$^$9!%(B
$B%?!<$r;2>H$9$k$K$O(B
scale
$B$H$$$&JQ?tL>$r;HMQ$7$^$9!%(B
-D varname=value
...
...
@@ -223,7 +223,7 @@ pgbench $B$G$O!$0J2<$N%7!<%1%s%9$rA4It40N;$7$F(B1$B%H%i%s%6%/%7%g%s$H?t$($F(
$BJQ?t$K1i;;$N7k2L$r@_Dj$9$k$K$O!$(B\set $B%a%?%3%^%s%I$r;HMQ$7$F0J(B
$B2<$N$h$&$K5-=R$7$^$9!%(B
\set ntellers 10 * :tp
s
\set ntellers 10 * :tp
$B$3$l$O!$JQ?t(B ntellers $B$K%9%1!<%j%s%0%U%!%/%?!<(B (-s $B%*%W%7%g%s(B
$B$G;XDj$7$?(B) $B$r(B 10 $BG\$7$?7k2L$r@_Dj$7$^$9!%(B
...
...
@@ -253,9 +253,9 @@ SELECT abalance FROM accounts WHERE aid = :aid
$B%6%/%7%g%s$NFbMF$r%U%!%$%k$K5-=R$7!$(B-f $B%*%W%7%g%s$K$h$C$F$=$N%U%!%$%k(B
$B$r;XDj$7$F(B pgbench $B$r<B9T$7$^$9!%(B
\set nbranches :
tps
\set ntellers 10 * :
tps
\set naccounts 100000 * :
tps
\set nbranches :
scale
\set ntellers 10 * :
scale
\set naccounts 100000 * :
scale
\setrandom aid 1 :naccounts
\setrandom bid 1 :nbranches
\setrandom tid 1 :ntellers
...
...
@@ -285,6 +285,10 @@ pgbench $B$O@P0f(B $BC#IW$K$h$C$F=q$+$l$^$7$?!%%i%$%;%s%9>r7o$O(B pgbench.c
$B"#2~DjMzNr(B
2006/09/13
* $BJQ?t(Btps$B$OJ6$i$o$7$$$N$G(Bscale$B$KJQ99!%%G%U%)%k%H%7%J%j%*$N;~$K!$(B
$B%G%U%)%k%H$N%9%1!<%j%s%0%U%!%/%?$r(Bbranches$B$+$i<h$C$F$3$J$$%P%0$r=$@5!%(B
2006/07/26
* $B:4F#$5$s$N%Q%C%A$rE,MQ!%0J2<$N5!G=DI2C!%(BPostgreSQL 8.2$B$K<h$j(B
$B9~$^$l$^$9!%(B
...
...
contrib/pgbench/pgbench.c
浏览文件 @
ea21eea6
/*
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.5
3 2006/08/15 13:05:30
ishii Exp $
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.5
4 2006/09/13 00:39:19
ishii Exp $
*
* pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii
...
...
@@ -58,10 +58,10 @@ int nclients = 1; /* default number of simulated clients */
int
nxacts
=
10
;
/* default number of transactions per clients */
/*
* scaling factor. for example,
tps
= 10 will make 1000000 tuples of
* scaling factor. for example,
scale
= 10 will make 1000000 tuples of
* accounts table.
*/
int
tps
=
1
;
int
scale
=
1
;
/*
* end of configurable parameters
...
...
@@ -134,9 +134,9 @@ int num_files; /* its number */
/* default scenario */
static
char
*
tpc_b
=
{
"
\\
set nbranches :
tps
\n
"
"
\\
set ntellers 10 * :
tps
\n
"
"
\\
set naccounts 100000 * :
tps
\n
"
"
\\
set nbranches :
scale
\n
"
"
\\
set ntellers 10 * :
scale
\n
"
"
\\
set naccounts 100000 * :
scale
\n
"
"
\\
setrandom aid 1 :naccounts
\n
"
"
\\
setrandom bid 1 :nbranches
\n
"
"
\\
setrandom tid 1 :ntellers
\n
"
...
...
@@ -152,9 +152,9 @@ static char *tpc_b = {
/* -N case */
static
char
*
simple_update
=
{
"
\\
set nbranches :
tps
\n
"
"
\\
set ntellers 10 * :
tps
\n
"
"
\\
set naccounts 100000 * :
tps
\n
"
"
\\
set nbranches :
scale
\n
"
"
\\
set ntellers 10 * :
scale
\n
"
"
\\
set naccounts 100000 * :
scale
\n
"
"
\\
setrandom aid 1 :naccounts
\n
"
"
\\
setrandom bid 1 :nbranches
\n
"
"
\\
setrandom tid 1 :ntellers
\n
"
...
...
@@ -168,7 +168,7 @@ static char *simple_update = {
/* -S case */
static
char
*
select_only
=
{
"
\\
set naccounts 100000 * :
tps
\n
"
"
\\
set naccounts 100000 * :
scale
\n
"
"
\\
setrandom aid 1 :naccounts
\n
"
"SELECT abalance FROM accounts WHERE aid = :aid;
\n
"
};
...
...
@@ -338,10 +338,13 @@ putVariable(CState * st, char *name, char *value)
}
else
{
if
((
value
=
strdup
(
value
))
==
NULL
)
char
*
val
;
if
((
val
=
strdup
(
value
))
==
NULL
)
return
false
;
free
(
var
->
value
);
var
->
value
=
val
ue
;
var
->
value
=
val
;
}
return
true
;
...
...
@@ -755,7 +758,7 @@ init(void)
}
PQclear
(
res
);
for
(
i
=
0
;
i
<
nbranches
*
tps
;
i
++
)
for
(
i
=
0
;
i
<
nbranches
*
scale
;
i
++
)
{
snprintf
(
sql
,
256
,
"insert into branches(bid,bbalance) values(%d,0)"
,
i
+
1
);
res
=
PQexec
(
con
,
sql
);
...
...
@@ -767,7 +770,7 @@ init(void)
PQclear
(
res
);
}
for
(
i
=
0
;
i
<
ntellers
*
tps
;
i
++
)
for
(
i
=
0
;
i
<
ntellers
*
scale
;
i
++
)
{
snprintf
(
sql
,
256
,
"insert into tellers(tid,bid,tbalance) values (%d,%d,0)"
,
i
+
1
,
i
/
ntellers
+
1
);
...
...
@@ -792,7 +795,7 @@ init(void)
* occupy accounts table with some data
*/
fprintf
(
stderr
,
"creating tables...
\n
"
);
for
(
i
=
0
;
i
<
naccounts
*
tps
;
i
++
)
for
(
i
=
0
;
i
<
naccounts
*
scale
;
i
++
)
{
int
j
=
i
+
1
;
...
...
@@ -1133,7 +1136,7 @@ printResults(
s
=
"Custom query"
;
printf
(
"transaction type: %s
\n
"
,
s
);
printf
(
"scaling factor: %d
\n
"
,
tps
);
printf
(
"scaling factor: %d
\n
"
,
scale
);
printf
(
"number of clients: %d
\n
"
,
nclients
);
printf
(
"number of transactions per client: %d
\n
"
,
nxacts
);
printf
(
"number of transactions actually processed: %d/%d
\n
"
,
normal_xacts
,
nxacts
*
nclients
);
...
...
@@ -1175,6 +1178,8 @@ main(int argc, char **argv)
PGresult
*
res
;
char
*
env
;
char
val
[
64
];
if
((
env
=
getenv
(
"PGHOST"
))
!=
NULL
&&
*
env
!=
'\0'
)
pghost
=
env
;
if
((
env
=
getenv
(
"PGPORT"
))
!=
NULL
&&
*
env
!=
'\0'
)
...
...
@@ -1248,10 +1253,10 @@ main(int argc, char **argv)
is_connect
=
1
;
break
;
case
's'
:
tps
=
atoi
(
optarg
);
if
(
tps
<=
0
)
scale
=
atoi
(
optarg
);
if
(
scale
<=
0
)
{
fprintf
(
stderr
,
"invalid scaling factor: %d
\n
"
,
tps
);
fprintf
(
stderr
,
"invalid scaling factor: %d
\n
"
,
scale
);
exit
(
1
);
}
break
;
...
...
@@ -1323,12 +1328,10 @@ main(int argc, char **argv)
remains
=
nclients
;
if
(
getVariable
(
&
state
[
0
],
"
tps
"
)
==
NULL
)
if
(
getVariable
(
&
state
[
0
],
"
scale
"
)
==
NULL
)
{
char
val
[
64
];
snprintf
(
val
,
sizeof
(
val
),
"%d"
,
tps
);
if
(
putVariable
(
&
state
[
0
],
"tps"
,
val
)
==
false
)
snprintf
(
val
,
sizeof
(
val
),
"%d"
,
scale
);
if
(
putVariable
(
&
state
[
0
],
"scale"
,
val
)
==
false
)
{
fprintf
(
stderr
,
"Couldn't allocate memory for variable
\n
"
);
exit
(
1
);
...
...
@@ -1405,13 +1408,20 @@ main(int argc, char **argv)
fprintf
(
stderr
,
"%s"
,
PQerrorMessage
(
con
));
exit
(
1
);
}
tps
=
atoi
(
PQgetvalue
(
res
,
0
,
0
));
if
(
tps
<
0
)
scale
=
atoi
(
PQgetvalue
(
res
,
0
,
0
));
if
(
scale
<
0
)
{
fprintf
(
stderr
,
"count(*) from branches invalid (%d)
\n
"
,
tps
);
fprintf
(
stderr
,
"count(*) from branches invalid (%d)
\n
"
,
scale
);
exit
(
1
);
}
PQclear
(
res
);
snprintf
(
val
,
sizeof
(
val
),
"%d"
,
scale
);
if
(
putVariable
(
&
state
[
0
],
"scale"
,
val
)
==
false
)
{
fprintf
(
stderr
,
"Couldn't allocate memory for variable
\n
"
);
exit
(
1
);
}
}
if
(
!
is_no_vacuum
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录