PgBench

PgBench

1. createdb pgbench

2. pgbench -i -s 10 -d pgbench
(Creates 10 branches, 100 tellers, 1000000 accounts and 0 history)

3.
Threads = 2 and transactions 2000, number of connections 98
/usr/local/postgres/pg9.01/bin/pgbench -t 2000 -j 2 -c 98 pgbench

To test update, select,update,insert in each transaction
a. begin;
b. update accounts set abalance = abalance + :delta where aid = :aid;
c. select abalance from accounts where aid = :aid;
d. update tellers set tbalance = tbalance + :delta where tid = :tid;
e. update branches set bbalance = bbalance + :delta where bid = :bid;
f. insert into history(tid,bid,aid,delta) values(:tid,:bid,:aid,:delta);
g. end;

4. Perform pgbench test analysis http://www.westnet.com/~gsmith/content/postgresql/pgbench-scaling.htm

 

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s