5 \e$B"#
\e(Bpgbench
\e$B$H$O!)
\e(B
7 pgbench
\e$B$O
\e(BPostgreSQL
\e$B$N%Y%s%A%^!<%/%F%9%H$r9T$J$&%W%m%0%i%`$G$9!%
\e(B
9 pgbench
\e$B$O
\e(B SELECT/UPDATE/INSERT
\e$B$r4^$`%H%i%s%6%/%7%g%s$r<B9T$7!$A4BN$N
\e(B
10 \e$B<B9T;~4V$H<B:]$K40N;$7$?%H%i%s%6%/%7%g%s$N?t$+$i
\e(B 1
\e$BIC4V$K<B9T$G$-$?%H
\e(B
11 \e$B%i%s%6%/%7%g%s?t
\e(B (tps)
\e$B$rI=<($7$^$9!%=hM}$NBP>]$H$J$k%F!<%V%k$O%G%U%)
\e(B
12 \e$B%k%H$G$O
\e(B 10
\e$BK|%?%W%k$N%G!<%?$r4^$_$^$9!%
\e(B
14 \e$B<B:]$NI=<($O0J2<$N$h$&$J46$8$G$9!%
\e(B
17 number of transactions per client: 100
18 number of processed transactions: 400/400
19 tps = 19.875015(including connections establishing)
20 tps = 20.098827(excluding connections establishing)
22 pgbench
\e$B$O
\e(B JDBCBench
\e$B$H$$$&!$$b$H$b$H$O
\e(B MySQL
\e$BMQ$K=q$+$l$?
\e(B JDBC
\e$BMQ$N%Y
\e(B
23 \e$B%s%A%^!<%/%W%m%0%i%`$r;29M$K:n@.$5$l$^$7$?!%
\e(B
25 \e$B"#
\e(Bpgbench
\e$B$NFCD'
\e(B
27 o C
\e$B8@8l$H
\e(B libpq
\e$B$@$1$G=q$+$l$F$$$k$N$G0\?"@-$,9b$/!$4JC1$K%$%s%9%H!<
\e(B
30 o pgbench
\e$B$O
\e(B libpq
\e$B$NHsF14|=hM}5!G=$r;H$C$F%^%k%A%f!<%64D6-$r%7%_%e%l!<
\e(B
31 \e$B%H$7$^$9!%MF0W$KF1;~@\B34D6-$r%F%9%H$G$-$^$9!%
\e(B
33 \e$B"#
\e(Bpgbench
\e$B$N%$%s%9%H!<%k
\e(B
35 PostgreSQL
\e$B$r%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e$B%*%U%;%C%H!W$O!$%H%i%s%6%/%7%g%s$,40N;$7$?$H
\e(B
148 \e$B$-$N
\e(BUNIX
\e$B%(%]%C%/%?%$%`$H%^%$%/%mICC10L$N%*%U%;%C%H$G$9
\e(B(ISO
149 8601
\e$B%?%$%`%9%?%s%W$HIC$NCf$NC<?t
\e(B)
\e$B!%
\e(B
151 \e$B%m%0$N=PNONc$r<($7$^$9!%
\e(B
153 0 199 2241 0 1175850568 995598
154 0 200 2465 0 1175850568 998079
155 0 201 2513 0 1175850569 608
156 0 202 2038 0 1175850569 2663
158 -F
\e$B%U%#%k%U%!%/%?!<
\e(B
159 accounts, tellers, bracnhes
\e$B%F!<%V%k$r:n@.$9$k:]$K;XDj$5$l$?%U%#
\e(B
160 \e$B%k%U%!%/%?!<$r;HMQ$7$^$9!%%U%#%k%U%!%/%?!<$N%G%U%)%k%H$O
\e(B100
\e$B$G
\e(B
161 \e$B$9!%$3$N%*%W%7%g%s$O
\e(B -i
\e$B%*%W%7%g%s$HF1;~$K;HMQ$7$^$9!%
\e(B
163 -d
\e$B%G%P%C%0%*%W%7%g%s!%MM!9$J>pJs$,I=<($5$l$^$9!%
\e(B
165 \e$B"#%G!<%?%Y!<%9$N=i4|2=
\e(B
167 pgbench
\e$B$G%Y%s%A%^!<%/%F%9%H$r<B;\$9$k$?$a$K$O!$$"$i$+$8$a%G!<%?%Y!<%9
\e(B
168 \e$B$r=i4|2=$7!$%F%9%H%G!<%?$r:n$kI,MW$,$"$j$^$9!%
\e(B-f
\e$B%*%W%7%g%s$r;H$C$FFH<+
\e(B
169 \e$B$N%H%i%s%6%/%7%g%s$rDj5A$9$k>l9g$O!$<+J,$G%G!<%?%Y!<%9$N=i4|2=$r$7$F$*
\e(B
170 \e$B$/I,MW$,$"$j$^$9!%
\e(B
172 $ pgbench -i [
\e$B%G!<%?%Y!<%9L>
\e(B]
174 \e$B$3$l$K$h$j0J2<$N%F!<%V%k$,:n$i$l$^$9
\e(B(
\e$B%9%1!<%j%s%0%U%!%/%?!<
\e(B == 1
\e$B$N>l9g
\e(B)
\e$B!%
\e(B
177 \e$BF1$8L>A0$N%F!<%V%k$,$"$k$H:o=|$5$l$F$7$^$&$N$G$4Cm0U2<$5$$!*!*
\e(B
179 \e$B%F!<%V%kL>
\e(B
\e$B%?%W%k?t
\e(B
180 -------------------------
186 \e$B%9%1!<%j%s%0%U%!%/%?!<$r
\e(B 10,100,1000
\e$B$J$I$KJQ99$9$k$H!$>e5-%?%W%k?t$O
\e(B
187 \e$B$=$l$K1~$8$F
\e(B10
\e$BG\!$
\e(B100
\e$BG\!$
\e(B1000
\e$BG\$K$J$j$^$9!%%F!<%V%k$H%$%s%G%C%/%9$N%5
\e(B
188 \e$B%$%:$O%G!<%?%Y!<%9%5%$%:$O35$M$=$l$>$l!$
\e(B130MB
\e$B!$
\e(B1.3GB
\e$B!$
\e(B13GB
\e$B$[$I$K$J$j$^
\e(B
191 \e$B$?$H$($P!$%9%1!<%j%s%0%U%!%/%?!<$r
\e(B 10
\e$B$H$9$k$H!$
\e(B
193 \e$B%F!<%V%kL>
\e(B
\e$B%?%W%k?t
\e(B
194 -------------------------
202 \e$B"#!V%H%i%s%6%/%7%g%s!W$NDj5A
\e(B
204 pgbench
\e$B$G$O!$0J2<$N%7!<%1%s%9$rA4It40N;$7$F
\e(B1
\e$B%H%i%s%6%/%7%g%s$H?t$($F
\e(B
209 (2) update accounts set abalance = abalance + :delta where aid = :aid;
210 \e$B$3$3$G!$
\e(B:delta
\e$B$O
\e(B1
\e$B$+$i
\e(B1000
\e$B$^$G$NCM$r<h$kMp?t!$
\e(B:aid
\e$B$O
\e(B 1
\e$B$+$i
\e(B100000
\e$B$^$G
\e(B
211 \e$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
\e(B
212 \e$BCf$G$OF1$8CM$r;H$$$^$9!%
\e(B
214 (3) select abalance from accounts where aid = :aid;
215 \e$B$3$3$G$O
\e(B1
\e$B7o$@$18!:w$5$l$^$9!%
\e(B
217 (4) update tellers set tbalance = tbalance + :delta where tid = :tid;
218 \e$B$3$3$G
\e(B :tid
\e$B$O
\e(B 1
\e$B$+$i
\e(B10
\e$B$N4V$NCM$r$H$kMp?t$G$9!%
\e(B
220 (5) update branches set bbalance = bbalance + :delta where bid = :bid;
221 \e$B$3$3$G
\e(B :bid
\e$B$O
\e(B 1
\e$B$+$i
\e(B[
\e$B%9%1%j%s%0%U%!%/%?!<
\e(B]
\e$B$N4V$NCM$r<h$kMp?t$G$9!%
\e(B
223 (6) insert into history(tid,bid,aid,delta) values(:tid,:bid,:aid,:delta);
227 -N
\e$B%*%W%7%g%s$r;HMQ$9$k$H!$
\e(B(4)(5)
\e$B$O<B9T$5$l$^$;$s!%
\e(B
229 \e$B"#F~NO%U%!%$%k$N%U%)!<%^%C%H
\e(B
231 -f
\e$B%*%W%7%g%s$r;XDj$7$F%H%i%s%6%/%7%g%s$K4^$^$l$k
\e(B SQL
\e$B%3%^%s%I$NFbMF$r
\e(B
232 \e$B5-=R$7$?%U%!%$%k$rFI$_9~$`$3$H$,$G$-$^$9!%F~NO%U%!%$%k$K$O
\e(B 1
\e$B9T$K$D$-
\e(B
233 1
\e$B$D$N%3%^%s%I$r5-=R$7$^$9!%6u9T$OL5;k$5$l!$Fs=E%O%$%U%s$G;O$^$k9T$O%3
\e(B
234 \e$B%a%s%H$r0UL#$7$^$9!%
\e(B
236 -f
\e$B%*%W%7%g%s$OJ#?t;XDj$G$-$^$9!%$3$N>l9g$O3F%H%i%s%6%/%7%g%s$K$O%i%s
\e(B
237 \e$B%@%`$KA*$P$l$?%U%!%$%k$K5-=R$5$l$?
\e(BSQL
\e$B$,<B9T$5$l$^$9!%
\e(B
239 \e$B%3%^%s%I$K$O!$
\e(BSQL
\e$B%3%^%s%I$K2C$(!$%P%C%/%9%i%C%7%e$G;O$^$k%a%?%3%^%s%I
\e(B
240 \e$B$r5-=R$G$-$^$9!%%a%?%3%^%s%I$O
\e(B pgbench
\e$B<+?H$K$h$C$F<B9T$5$l$^$9!%%a%?
\e(B
241 \e$B%3%^%s%I$N7A<0$O%P%C%/%9%i%C%7%e!$$=$ND>8e$K%3%^%s%I$NF0;l!$$=$N<!$K0z
\e(B
242 \e$B?t$,B3$-$^$9!%F0;l%3%^%s%I$H0z?t!$$^$?$=$l$>$l$N0z?t$O6uGrJ8;z$K$h$C$F
\e(B
243 \e$B6h@Z$i$l$^$9!%
\e(B
245 \e$B8=:_$N$H$3$m!$0J2<$N%a%?%3%^%s%I$,Dj5A$5$l$F$$$^$9!%
\e(B
247 \set name operand1 [ operator operand2 ]
248 \e$BHo1i;;?t
\e(B operand1
\e$B$H
\e(B operand2
\e$B$r1i;;;R
\e(B operator
\e$B$K$h$C$F1i;;$7
\e(B
249 \e$B$?7k2L$rJQ?t
\e(B name
\e$B$K@_Dj$7$^$9!%8=>u$G$O@0?t$N;MB'1i;;$N$_$KBP
\e(B
250 \e$B1~$7$F$$$^$9!%$J$*!$1i;;;R$H
\e(B 2
\e$B$DL\$NHo1i;;?t$r>JN,$9$k$HC1=c
\e(B
251 \e$B$K
\e(B 1
\e$B$DL\$NHo1i;;?t$rJQ?t$K@_Dj$7$^$9!%
\e(B
253 \e$BJQ?t$K1i;;$N7k2L$r@_Dj$9$k$K$O!$
\e(B\set
\e$B%a%?%3%^%s%I$r;HMQ$7$F0J
\e(B
254 \e$B2<$N$h$&$K5-=R$7$^$9!%
\e(B
256 \set ntellers 10 * :tp
258 \e$B$3$l$O!$JQ?t
\e(B ntellers
\e$B$K%9%1!<%j%s%0%U%!%/%?!<
\e(B (-s
\e$B%*%W%7%g%s
\e(B
259 \e$B$G;XDj$7$?
\e(B)
\e$B$r
\e(B 10
\e$BG\$7$?7k2L$r@_Dj$7$^$9!%
\e(B
261 \setrandom name min max
263 \e$B:G>.CM
\e(B min
\e$B$H:GBgCM
\e(B max
\e$B$N4V$NCM$r<h$kMp?t$r!$
\e(Bname
\e$BJQ?t$K@_Dj
\e(B
266 \e$BJQ?t$KMp?t$r@_Dj$9$k$K$O!$
\e(B\setrandom
\e$B%a%?%3%^%s%I$r;HMQ$7$F0J2<$N$h$&
\e(B
267 \e$B$K5-=R$7$^$9!%
\e(B
269 \setrandom aid 1 100000
271 \e$B$3$l$O!$JQ?t
\e(B aid
\e$B$K
\e(B 1
\e$B$+$i
\e(B 100000
\e$B$N4V$NMp?t$r@_Dj$7$^$9!%
\e(B
273 \e$BJQ?t$O
\e(B SQL
\e$B%3%^%s%I$*$h$S%a%?%3%^%s%I$+$i;2>H$G$-$^$9!%$=$l$K$O0J2<$N
\e(B
274 \e$B$h$&$KJQ?tL>$NA0$K%3%m%s$rIU$1$^$9!%
\e(B
276 SELECT abalance FROM accounts WHERE aid = :aid
278 \e$BJQ?t$rDj5A$9$k$K$O%a%?%3%^%s%I0J30$K
\e(B -D
\e$B%*%W%7%g%s$r;HMQ$9$k$3$H$b$G$-
\e(B
279 \e$B$^$9!%
\e(B -D
\e$B%*%W%7%g%s$GDj5A$7$?JQ?t$bJQ?tL>$NA0$K%3%m%s$rIU$1$F;2>H$7$^
\e(B
282 \e$BNc$($P!$
\e(BTCP-B
\e$B$KN`;w$7$?%Y%s%A%^!<%/$r7WB,$9$k$K$O!$0J2<$N$h$&$K%H%i%s
\e(B
283 \e$B%6%/%7%g%s$NFbMF$r%U%!%$%k$K5-=R$7!$
\e(B-f
\e$B%*%W%7%g%s$K$h$C$F$=$N%U%!%$%k
\e(B
284 \e$B$r;XDj$7$F
\e(B pgbench
\e$B$r<B9T$7$^$9!%
\e(B
286 \set nbranches :scale
287 \set ntellers 10 * :scale
288 \set naccounts 100000 * :scale
289 \setrandom aid 1 :naccounts
290 \setrandom bid 1 :nbranches
291 \setrandom tid 1 :ntellers
292 \setrandom delta 1 10000
294 UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid
295 SELECT abalance FROM accounts WHERE aid = :aid
296 UPDATE tellers SET tbalance = tbalance + :delta WHERE tid = :tid
297 UPDATE branches SET bbalance = bbalance + :delta WHERE bid = :bid
298 INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, current_timestamp)
301 \e$B%9%1!<%j%s%0%U%!%/%?!<$r
\e(B branches
\e$B%F!<%V%k$N%?%W%k?t$+$i<+F0E*$K@_Dj$7
\e(B
302 \e$B$?$$>l9g!$0J2<$N$h$&$K
\e(B -s
\e$B%*%W%7%g%s$H%7%'%k$N%3%^%s%ICV49$J$I$rAH$_9g
\e(B
305 pgbench -s $(psql -At -c "SELECT count(*) FROM branches") -f tpc_b.sql
307 \e$B$J$*!$
\e(B-f
\e$B%*%W%7%g%s$r;XDj$7$?>l9g!$%Y%s%A%^!<%/3+;OA0$K
\e(B vacuum
\e$B$H
\e(B
308 history
\e$B$N%/%j%"$O<+F0E*$K9T$o$l$^$;$s!%
\e(B
310 \e$B"#:n<T$H%i%$%;%s%9>r7o
\e(B
312 pgbench
\e$B$O@P0f
\e(B
\e$BC#IW$K$h$C$F=q$+$l$^$7$?!%%i%$%;%s%9>r7o$O
\e(B pgbench.c
\e$B$N
\e(B
313 \e$BKAF,$K=q$$$F$"$j$^$9!%$3$N>r7o$r<i$k8B$jL5=~$GMxMQ$7!$$^$?<+M3$K:FG[IU
\e(B
316 \e$B"#
\e(BPostgreSQL
\e$B$N
\e(Bcontrib
\e$B%b%8%e!<%k$H$7$F<h$j9~$^$l$k$^$G$N2~DjMzNr
\e(B
318 2000/1/15 pgbench-1.2
\e$B$O
\e(B PostgreSQL
\e$B$K
\e(B contribute
\e$B$5$l$^$7$?!%
\e(B
319 * -v
\e$B%*%W%7%g%sDI2C
\e(B
321 1999/09/29 pgbench-1.1
\e$B%j%j!<%9
\e(B
322 *
\e$BC+ED$5$s$K$h$k
\e(Bcygwin
\e$BBP1~%Q%C%A<h$j9~$_
\e(B
323 *
\e$B%P%C%/%(%s%I%/%i%C%7%e;~$NBP1~
\e(B
324 * -S
\e$B%*%W%7%g%sDI2C
\e(B
326 1999/09/04 pgbench-1.0
\e$B%j%j!<%9
\e(B