\set aid random(1, 100000 * :scale)
\set bid random(1, 1 * :scale)
\set tid random(1, 10 * :scale)
\set delta random(-5000, 5000)
BEGIN;
SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
UPDATE pgbench_accounts SET aid = aid + :delta WHERE aid = :aid;
SELECT tbalance FROM pgbench_tellers WHERE tid = :tid;
UPDATE pgbench_tellers SET tid = tid + :delta WHERE tid = :tid;
SELECT bbalance FROM pgbench_branches WHERE bid = :bid;
UPDATE pgbench_branches SET bid = bid + :delta WHERE bid = :bid;
INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
END;
