Created
June 23, 2018 16:04
-
-
Save erthalion/c85ba0e12146596d24c572234501e756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\set aid random_zipfian(1, 100000 * :scale, 1.07) | |
\set bid random_zipfian(1, 1 * :scale, 1.07) | |
\set tid random_zipfian(1, 10 * :scale, 1.07) | |
\set delta random(-5000, 5000) | |
BEGIN; | |
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment