Add initial 8.4 support
authorGreg Smith <gsmith@gsmith-desktop.(none)>
Fri, 8 Jan 2010 20:47:22 +0000 (15:47 -0500)
committerGreg Smith <gsmith@gsmith-desktop.(none)>
Fri, 8 Jan 2010 20:47:22 +0000 (15:47 -0500)
15 files changed:
HISTORY
README
config
runset
tests-8.3/insert-size.sql [new file with mode: 0644]
tests-8.3/insert.sql [new file with mode: 0644]
tests-8.3/nobranch.sql [new file with mode: 0644]
tests-8.3/select.sql [new file with mode: 0644]
tests-8.3/tpc-b.sql [new file with mode: 0644]
tests-8.3/update.sql [new file with mode: 0644]
tests/insert.sql
tests/nobranch.sql
tests/select.sql
tests/tpc-b.sql
tests/update.sql

diff --git a/HISTORY b/HISTORY
index f999c7808546ee41fa78e17c5f2fbbf62ca9f811..7dab01a4a35d88c26ec65faf31511712bbebd394 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -8,3 +8,5 @@
                Bugs reported by Robert Treat and Jignesh Shah fixed,
                improving compatiblity with Solaris.
 
+0.5    2010-01-08 Add PostgreSQL 8.4 and later support.  README is now valid
+               reST.
diff --git a/README b/README
index 8c598001144b2f5b54dd91f8ab0efc08919cc65c..0b43616d514068182b87e7b7d8c9d9b62ff35763 100644 (file)
--- a/README
+++ b/README
@@ -1,61 +1,75 @@
 pgbench-tools Setup
 ===================
 
--Create databases for your test and for the results
---Both databases can be the same, but there may be more shared_buffers
-  cache churn in that case.  Some amount of cache disruption
-  is unavoidable unless the result database is remote, because
-  of the OS cache.
+* Create databases for your test and for the results
 
--Initialize the results database by executing
+  *  Both databases can be the same, but there may be more shared_buffers
+     cache churn in that case.  Some amount of cache disruption
+     is unavoidable unless the result database is remote, because
+     of the OS cache.
 
-  psql -f init/resultdb.sql
+* Initialize the results database by executing::
+
+    psql -f init/resultdb.sql
+
+  This will create a default test set entry with a blank description.
+  You may want to rename this.
 
 Running tests
 =============
 
--Edit the config file to run the tests you want
+Edit the config file to run the tests you want
 
--Execute
+* Execute::
 
-  ./runset
+    ./runset
 
- In order to execute all the tests
 In order to execute all the tests
 
 Results
 =======
 
--You can check results even as the test is running with:
+* You can check results even as the test is running with::
 
-  psql [resultdb] -f report.sql
+    psql [resultdb] -f report.sql
 
--Other useful reports you can run include:
+Other useful reports you can run include:
    * summary.sql
    * bufreport.sql
    * bufsummary.sql
  
--Once the tests are done, the results/ directory will include
- a HTML subdirectory for each test giving its results,
- in addition to the summary information in the results database.
+Once the tests are done, the results/ directory will include
 a HTML subdirectory for each test giving its results,
 in addition to the summary information in the results database.
 
--The results directory will also include its own index file that
- shows summary information and plots for all the tests.
+The results directory will also include its own index file that
 shows summary information and plots for all the tests.
 
--If you manually adjust the test result database, you can
manually regenerate the summary graphs by running:
+If you manually adjust the test result database, you can
 manually regenerate the summary graphs by running::
 
-  ./webreport
+    ./webreport
 
-Known issues
-============
+Version Compatibility
+=====================
 
--If running tests against non-pgbench tables, the database scale
- will not be detected correctly yet
+The default configuration now aims to support the pgbench that ships with
+PostgreSQL 8.4 and later versions, which uses names such as "pgbench_accounts"
+for its tables.  There are commented out settings on the config file that
+show what changes need to be made in order to make the program compatible
+with PostgreSQL 8.3, where the names were like "accounts" instead.
 
--Recent PostgreSQL 8.4 development releases have changed the
- names of all the pgbench tables such that this program doesn't
- work against recent code snapshots yet
+Support for PostgreSQL versions before 8.3 is not possible, because a
+change was made to the pgbench client in that version that is needed
+by the program to work properly.  It is possible to use the PostgreSQL 8.3
+pgbench client against a newer database server, or to copy the pgbench.c
+program from 8.3 into a 8.2 source code build and use it instead.
+
+Known issues
+============
 
--On Solaris, where the benchwarmer script calls tail it may need
- to use /usr/xpg4/bin/tail instead
+* If running tests against non-pgbench tables, the database scale
+  will not be detected correctly yet
 
+* On Solaris, where the benchwarmer script calls tail it may need
+  to use /usr/xpg4/bin/tail instead
diff --git a/config b/config
index 1be570b9af50f6f2dbb64fef02d0bc4957a27238..55a9cc89f14d7066863b0514ae19e0379539f90d 100755 (executable)
--- a/config
+++ b/config
@@ -1,6 +1,14 @@
 BASEDIR=`pwd`
 PGBENCHBIN=`which pgbench`
 
+# These values are for pgbench 8.4 and later
+TABLEPREFIX="pgbench_"
+TESTDIR="tests"
+
+# Use these values for pgbench 8.3
+#TABLEPREFIX=""
+#TESTDIR="tests-8.3"
+
 TESTHOST=localhost
 TESTUSER=postgres
 TESTDB=pgbench
diff --git a/runset b/runset
index c244495844cb4fb761551b2ba3c3033ea2f72cc5..af3f6018368ed4c0877ea6882e7910ef47a30e3b 100755 (executable)
--- a/runset
+++ b/runset
@@ -17,7 +17,7 @@ for SCALE in $SCALES; do
   if [ "$SKIPINIT" -ne "1" ]; then
     echo Removing old pgbench tables
     TESTPSQL="psql -h $TESTHOST -U $TESTUSER -p $TESTPORT -d $TESTDB"
-    $TESTPSQL -c "drop table accounts; drop table branches; drop table tellers; drop table history;"
+    $TESTPSQL -c "drop table ${TABLEPREFIX}accounts; drop table ${TABLEPREFIX}branches; drop table ${TABLEPREFIX}tellers; drop table ${TABLEPREFIX}history;"
     $TESTPSQL -c "vacuum full"
 
     echo Creating new pgbench tables
diff --git a/tests-8.3/insert-size.sql b/tests-8.3/insert-size.sql
new file mode 100644 (file)
index 0000000..b8ce9c7
--- /dev/null
@@ -0,0 +1 @@
+insert into data (filler) values (repeat(' ',:scale));
diff --git a/tests-8.3/insert.sql b/tests-8.3/insert.sql
new file mode 100644 (file)
index 0000000..9451ba8
--- /dev/null
@@ -0,0 +1,8 @@
+\set nbranches :scale
+\set ntellers 10 * :scale
+\set naccounts 100000 * :scale
+\setrandom aid 1 :naccounts
+\setrandom bid 1 :nbranches
+\setrandom tid 1 :ntellers
+\setrandom delta -5000 5000
+INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
diff --git a/tests-8.3/nobranch.sql b/tests-8.3/nobranch.sql
new file mode 100644 (file)
index 0000000..724ae85
--- /dev/null
@@ -0,0 +1,12 @@
+\set nbranches :scale
+\set ntellers 10 * :scale
+\set naccounts 100000 * :scale
+\setrandom aid 1 :naccounts
+\setrandom bid 1 :nbranches
+\setrandom tid 1 :ntellers
+\setrandom delta -5000 5000
+BEGIN;
+UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid;
+SELECT abalance FROM accounts WHERE aid = :aid;
+INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
+END;
diff --git a/tests-8.3/select.sql b/tests-8.3/select.sql
new file mode 100644 (file)
index 0000000..caa5301
--- /dev/null
@@ -0,0 +1,3 @@
+\set naccounts 100000 * :scale
+\setrandom aid 1 :naccounts
+SELECT abalance FROM accounts WHERE aid = :aid;
diff --git a/tests-8.3/tpc-b.sql b/tests-8.3/tpc-b.sql
new file mode 100644 (file)
index 0000000..4a0688d
--- /dev/null
@@ -0,0 +1,14 @@
+\set nbranches :scale
+\set ntellers 10 * :scale
+\set naccounts 100000 * :scale
+\setrandom aid 1 :naccounts
+\setrandom bid 1 :nbranches
+\setrandom tid 1 :ntellers
+\setrandom delta -5000 5000
+BEGIN;
+UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid;
+SELECT abalance FROM accounts WHERE aid = :aid;
+UPDATE tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
+UPDATE branches SET bbalance = bbalance + :delta WHERE bid = :bid;
+INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
+END;
diff --git a/tests-8.3/update.sql b/tests-8.3/update.sql
new file mode 100644 (file)
index 0000000..470cf98
--- /dev/null
@@ -0,0 +1,8 @@
+\set nbranches :scale
+\set ntellers 10 * :scale
+\set naccounts 100000 * :scale
+\setrandom aid 1 :naccounts
+\setrandom bid 1 :nbranches
+\setrandom tid 1 :ntellers
+\setrandom delta -5000 5000
+UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid;
index 9451ba8d9b36a5b8d04dddbd163fb18fdc2cb100..d87be32a3e463ad62871065e73dc3344332b8082 100644 (file)
@@ -5,4 +5,4 @@
 \setrandom bid 1 :nbranches
 \setrandom tid 1 :ntellers
 \setrandom delta -5000 5000
-INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
+INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
index 724ae857a7306fbfbe769eef63a43cec98270d62..284422b7ecbec1a83f9d79a16ff97fb71f9d5b10 100644 (file)
@@ -6,7 +6,7 @@
 \setrandom tid 1 :ntellers
 \setrandom delta -5000 5000
 BEGIN;
-UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid;
-SELECT abalance FROM accounts WHERE aid = :aid;
-INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
+UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
+SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
+INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
 END;
index caa5301036188f5e8063df9f26b2663bca4d9c4e..55c41ab8bc8a2b2096772a55ea9e359b86e71e03 100644 (file)
@@ -1,3 +1,3 @@
 \set naccounts 100000 * :scale
 \setrandom aid 1 :naccounts
-SELECT abalance FROM accounts WHERE aid = :aid;
+SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
index 4a0688dc9f70e02fef9e0d21fd329579bbd8372d..2a72d8f085a8197190052c3c3340b637212d9fd1 100644 (file)
@@ -6,9 +6,9 @@
 \setrandom tid 1 :ntellers
 \setrandom delta -5000 5000
 BEGIN;
-UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid;
-SELECT abalance FROM accounts WHERE aid = :aid;
-UPDATE tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
-UPDATE branches SET bbalance = bbalance + :delta WHERE bid = :bid;
-INSERT INTO history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
+UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;
+SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
+UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
+UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
+INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
 END;
index 470cf98345e6fd9094821efa1738e5f27a3d8943..97cb3df3515924d64a526536e403be18e8d550a0 100644 (file)
@@ -5,4 +5,4 @@
 \setrandom bid 1 :nbranches
 \setrandom tid 1 :ntellers
 \setrandom delta -5000 5000
-UPDATE accounts SET abalance = abalance + :delta WHERE aid = :aid;
+UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;