mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
5.8 KiB
5.8 KiB
pgbench 1.2 README 2000/1/15 Tatsuo Ishii (t-ishii@sra.co.jp)
$B"#pgbench $B$H$O!)
pgbench $B$O TPC-B$B$K;w$?%Y%s%A%^!<%/%F%9%H$r9T$J$&%W%m%0%i%`$G$9!#:#$N$H
$B$3$m PostgreSQL $B@lMQ$G$9!#
pgbench $B$O select/update/insert $B$r4^$`%H%i%s%6%/%7%g%s$r<B9T$7!"A4BN$N
$B<B9T;~4V$H<B:]$K40N;$7$?%H%i%s%6%/%7%g%s$N?t$+$i 1 $BIC4V$K<B9T$G$-$?%H
$B%i%s%6%/%7%g%s?t (tps) $B$rI=<($7$^$9!#=hM}$NBP>]$H$J$k%F!<%V%k$O%G%U%)
$B%k%H$G$O 10$BK|%?%W%k$N%G!<%?$r4^$_$^$9!#
$B<B:]$NI=<($O0J2<$N$h$&$J46$8$G$9!#
number of clients: 4
number of transactions per client: 100
number of processed transactions: 400/400
tps = 19.875015(including connections establishing)
tps = 20.098827(excluding connections establishing)
pgbench $B$O JDBCBench $B$H$$$&!"$b$H$b$H$O MySQL $BMQ$K=q$+$l$? JDBC $BMQ$N%Y
$B%s%A%^!<%/%W%m%0%i%`$r;29M$K:n@.$5$l$^$7$?!#
$B"#pgbench $B$NFCD'
o C $B8@8l$H libpq $B$@$1$G=q$+$l$F$$$k$N$G0\?"@-$,9b$/!"4JC1$K%$%s%9%H!<
$B%k$G$-$^$9!#
o pgbench $B$O libpq $B$NHsF14|=hM}5!G=$r;H$C$F%^%k%A%f!<%64D6-$r%7%_%e%l!<
$B%H$7$^$9!#MF0W$KF1;~@\B34D6-$r%F%9%H$G$-$^$9!#
$B"#pgbench $B$N%$%s%9%H!<%k
Makefile$B$N0lHV>e$K$"$k
POSTGRESHOME = /usr/local/pgsql
$B$rI,MW$K1~$8$F=$@5$7!"configure;make $B$9$k$@$1$G$9!#
$B"#pgbench $B$N;H$$J}
$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%U%!%/%?!< == 1 $B$N>l9g)$B!#
$B!vCm0U!v
$BF1$8L>A0$N%F!<%V%k$,$"$k$H:o=|$5$l$F$7$^$&$N$G$4Cm0U2<$5$$!*!*
$B%F!<%V%kL> $B%?%W%k?t
-------------------------
branches 1
tellers 10
accounts 100000
history 0
$B%9%1!<%j%s%0%U%!%/%?!<$r 10,100,1000 $B$J$I$KJQ99$9$k$H!">e5-%?%W%k?t$O
$B$=$l$K1~$8$F10$BG\!"100$BG\!"1000$BG\$K$J$j$^$9!#$?$H$($P!"%9%1!<%j%s%0%U%!
$B%/%?!<$r 10 $B$H$9$k$H!"
$B%F!<%V%kL> $B%?%W%k?t
-------------------------
branches 10
tellers 100
accounts 1000000
history 0
$B$K$J$j$^$9!#
$B"#!V%H%i%s%6%/%7%g%s!W$NDj5A
pgbench $B$G$O!"0J2<$N%7!<%1%s%9$rA4It40N;$7$F1$B%H%i%s%6%/%7%g%s$H?t$($F
$B$$$^$9!#
(1) begin;
(2) update accounts set abalance = abalance + :delta where aid = :aid;
$B$3$3$G!":delta$B$O1$B$+$i1000$B$^$G$NCM$r<h$kMp?t!":aid $B$O 1$B$+$i100000$B$^$G
$B$NCM$r<h$kMp?t$G$9!#0J2<!"Mp?t$NCM$O$=$l$>$l$3$N%H%i%s%6%/%7%g%s$N
$BCf$G$OF1$8CM$r;H$$$^$9!#
(3) select abalance from accounts where aid = :aid;
$B$3$3$G$O1$B7o$@$18!:w$5$l$^$9!#
(4) update tellers set tbalance = tbalance + :delta where tid = :tid;
$B$3$3$G :tid $B$O 1$B$+$i10$B$N4V$NCM$r$H$kMp?t$G$9!#
(5) update branches set bbalance = bbalance + :delta where bid = :bid;
$B$3$3$G :bid $B$O 1 $B$+$i[$B%9%1%j%s%0%U%!%/%?!<]$B$N4V$NCM$r<h$kMp?t$G$9!#
(6) insert into history(tid,bid,aid,delta) values(:tid,:bid,:aid,:delta);
(7) end;
$B"#:n<T$H%i%$%;%s%9>r7o
pgbench $B$O@P0f $BC#IW$K$h$C$F=q$+$l$^$7$?!#%i%$%;%s%9>r7o$O pgbench.c $B$N
$BKAF,$K=q$$$F$"$j$^$9!#$3$N>r7o$r<i$k8B$jL5=~$GMxMQ$7!"$^$?<+M3$K:FG[IU
$B$G$-$^$9!#
$B"#2~DjMzNr
2000/1/15 pgbench-1.2 $B$O PostgreSQL $B$K contribute $B$5$l$^$7$?!#
* -v $B%*%W%7%g%sDI2C
1999/09/29 pgbench-1.1 $B%j%j!<%9
* $BC+ED$5$s$K$h$kcygwin$BBP1~%Q%C%A<h$j9~$_
* $B%P%C%/%(%s%I%/%i%C%7%e;~$NBP1~
* -S $B%*%W%7%g%sDI2C
1999/09/04 pgbench-1.0 $B%j%j!<%9
$B"#pgbench $B$H$O!)
pgbench $B$O TPC-B$B$K;w$?%Y%s%A%^!<%/%F%9%H$r9T$J$&%W%m%0%i%`$G$9!#:#$N$H
$B$3$m PostgreSQL $B@lMQ$G$9!#
pgbench $B$O select/update/insert $B$r4^$`%H%i%s%6%/%7%g%s$r<B9T$7!"A4BN$N
$B<B9T;~4V$H<B:]$K40N;$7$?%H%i%s%6%/%7%g%s$N?t$+$i 1 $BIC4V$K<B9T$G$-$?%H
$B%i%s%6%/%7%g%s?t (tps) $B$rI=<($7$^$9!#=hM}$NBP>]$H$J$k%F!<%V%k$O%G%U%)
$B%k%H$G$O 10$BK|%?%W%k$N%G!<%?$r4^$_$^$9!#
$B<B:]$NI=<($O0J2<$N$h$&$J46$8$G$9!#
number of clients: 4
number of transactions per client: 100
number of processed transactions: 400/400
tps = 19.875015(including connections establishing)
tps = 20.098827(excluding connections establishing)
pgbench $B$O JDBCBench $B$H$$$&!"$b$H$b$H$O MySQL $BMQ$K=q$+$l$? JDBC $BMQ$N%Y
$B%s%A%^!<%/%W%m%0%i%`$r;29M$K:n@.$5$l$^$7$?!#
$B"#pgbench $B$NFCD'
o C $B8@8l$H libpq $B$@$1$G=q$+$l$F$$$k$N$G0\?"@-$,9b$/!"4JC1$K%$%s%9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0%*%W%7%g%s!#MM!9$J>pJs$,I=<($5$l$^$9!#
$B"#%G!<%?%Y!<%9$N=i4|2=
pgbench $B$G%Y%s%A%^!<%/%F%9%H$r<B;\$9$k$?$a$K$O!"$"$i$+$8$a%G!<%?%Y!<%9
$B$r=i4|2=$7!"%F%9%H%G!<%?$r:n$kI,MW$,$"$j$^$9!#
$ pgbench -i [$B%G!<%?%Y!<%9L>]
$B$3$l$K$h$j0J2<$N%F!<%V%k$,:n$i$l$^$9($B%9%1!<%j%s%0%U%!%/%?!< == 1 $B$N>l9g)$B!#
$B!vCm0U!v
$BF1$8L>A0$N%F!<%V%k$,$"$k$H:o=|$5$l$F$7$^$&$N$G$4Cm0U2<$5$$!*!*
$B%F!<%V%kL> $B%?%W%k?t
-------------------------
branches 1
tellers 10
accounts 100000
history 0
$B%9%1!<%j%s%0%U%!%/%?!<$r 10,100,1000 $B$J$I$KJQ99$9$k$H!">e5-%?%W%k?t$O
$B$=$l$K1~$8$F10$BG\!"100$BG\!"1000$BG\$K$J$j$^$9!#$?$H$($P!"%9%1!<%j%s%0%U%!
$B%/%?!<$r 10 $B$H$9$k$H!"
$B%F!<%V%kL> $B%?%W%k?t
-------------------------
branches 10
tellers 100
accounts 1000000
history 0
$B$K$J$j$^$9!#
$B"#!V%H%i%s%6%/%7%g%s!W$NDj5A
pgbench $B$G$O!"0J2<$N%7!<%1%s%9$rA4It40N;$7$F1$B%H%i%s%6%/%7%g%s$H?t$($F
$B$$$^$9!#
(1) begin;
(2) update accounts set abalance = abalance + :delta where aid = :aid;
$B$3$3$G!":delta$B$O1$B$+$i1000$B$^$G$NCM$r<h$kMp?t!":aid $B$O 1$B$+$i100000$B$^$G
$B$NCM$r<h$kMp?t$G$9!#0J2<!"Mp?t$NCM$O$=$l$>$l$3$N%H%i%s%6%/%7%g%s$N
$BCf$G$OF1$8CM$r;H$$$^$9!#
(3) select abalance from accounts where aid = :aid;
$B$3$3$G$O1$B7o$@$18!:w$5$l$^$9!#
(4) update tellers set tbalance = tbalance + :delta where tid = :tid;
$B$3$3$G :tid $B$O 1$B$+$i10$B$N4V$NCM$r$H$kMp?t$G$9!#
(5) update branches set bbalance = bbalance + :delta where bid = :bid;
$B$3$3$G :bid $B$O 1 $B$+$i[$B%9%1%j%s%0%U%!%/%?!<]$B$N4V$NCM$r<h$kMp?t$G$9!#
(6) insert into history(tid,bid,aid,delta) values(:tid,:bid,:aid,:delta);
(7) end;
$B"#:n<T$H%i%$%;%s%9>r7o
pgbench $B$O@P0f $BC#IW$K$h$C$F=q$+$l$^$7$?!#%i%$%;%s%9>r7o$O pgbench.c $B$N
$BKAF,$K=q$$$F$"$j$^$9!#$3$N>r7o$r<i$k8B$jL5=~$GMxMQ$7!"$^$?<+M3$K:FG[IU
$B$G$-$^$9!#
$B"#2~DjMzNr
2000/1/15 pgbench-1.2 $B$O PostgreSQL $B$K contribute $B$5$l$^$7$?!#
* -v $B%*%W%7%g%sDI2C
1999/09/29 pgbench-1.1 $B%j%j!<%9
* $BC+ED$5$s$K$h$kcygwin$BBP1~%Q%C%A<h$j9~$_
* $B%P%C%/%(%s%I%/%i%C%7%e;~$NBP1~
* -S $B%*%W%7%g%sDI2C
1999/09/04 pgbench-1.0 $B%j%j!<%9