summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Vondra2017-06-03 14:17:00 +0000
committerTomas Vondra2017-06-03 14:17:00 +0000
commitc2b1e01aed3fe5c03e18641e42562744f2ae26d9 (patch)
tree3eb3bde41c48e1e8702927caf4dae389e6047203 /src
parent32d57848458595a487d251b37c2872d86de439ef (diff)
Make pgbench script names (name prefixes) unique
PostgreSQL 9.6 picks the built-in scripts by prefix, as long as a single script is matched. This is done even when not using the '-b' option as in that case pgbench simply uses 'tpcb-like' (and 'pgbench -N' defaults to 'simple-update'). XL adds two custom scripts that also use the 'bid' column in WHERE conditions, not just the 'aid' one. Those scripts were however named 'tpcb-like-bid' and 'simple-update-bid' which makes the upstream names non-unique (when used as prefixes). This fixes it by simply not keeping the upstream scripts, and replacing them with the XL version. It might have been possible to massage the builtin_script[] array to keep both, but it doesn't seem worth it.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/pgbench.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index ab72c7be63..364b91ce31 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -347,22 +347,6 @@ static const BuiltinScript builtin_script[] =
"\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n"
"\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n"
"\\set tid random(1, " CppAsString2(ntellers) " * :scale)\n"
- "\\set delta random(-5000, 5000)\n"
- "BEGIN;\n"
- "UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;\n"
- "SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n"
- "UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;\n"
- "UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;\n"
- "INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n"
- "END;\n"
- },
-#ifdef PGXC
- {
- "tpcb-like-bid",
- "<builtin: TPC-B (sort of)>",
- "\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n"
- "\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n"
- "\\set tid random(1, " CppAsString2(ntellers) " * :scale)\n"
"\\setrandom delta -5000 5000\n"
"BEGIN;\n"
"UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid AND bid = :bid;\n"
@@ -372,23 +356,8 @@ static const BuiltinScript builtin_script[] =
"INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n"
"END;\n"
},
-#endif
{
"simple-update",
- "<builtin: simple update>",
- "\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n"
- "\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n"
- "\\set tid random(1, " CppAsString2(ntellers) " * :scale)\n"
- "\\set delta random(-5000, 5000)\n"
- "BEGIN;\n"
- "UPDATE pgbench_accounts SET abalance = abalance + :delta WHERE aid = :aid;\n"
- "SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n"
- "INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n"
- "END;\n"
- },
-#ifdef PGXC
- {
- "simple-update-bid",
"<builtin: simple update bid>",
"\\set aid random(1, " CppAsString2(naccounts) " * :scale)\n"
"\\set bid random(1, " CppAsString2(nbranches) " * :scale)\n"
@@ -400,7 +369,6 @@ static const BuiltinScript builtin_script[] =
"INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n"
"END;\n"
},
-#endif
{
"select-only",
"<builtin: select only>",