demo_server.postgres $ cat create_table.sql
drop table if exists test_indexes;
CREATE TABLE test_indexes (id BIGSERIAL, bool_data BOOLEAN, int_data INT, text_data TEXT, PRIMARY KEY(id));
CREATE INDEX ON test_indexes USING BTREE (int_data);
demo_server.postgres $ cat insert.sql
INSERT INTO test_indexes (bool_data , int_data , text_data )
VALUES ( (RANDOM()*10)::INT % 2 = 0, 42, MD5((RANDOM()*1000)::TEXT) );
demo_server.postgres $ for p in 9500 11000; do
> echo "* DB ON PORT $p *";
> /usr/pgsql-11/bin/psql -Upostgres -qp $p -f create_table.sql;
> /usr/pgsql-11/bin/pgbench -Upostgres -f insert.sql -n -c 60 -j 60 -T1800 postgres -p $p;
> done
* DB ON PORT 9500 *
transaction type: insert.sql
scaling factor: 1
query mode: simple
number of clients: 60
number of threads: 60
duration: 1800 s
number of transactions actually processed: 88826370
latency average = 1.216 ms
tps = 49347.886303 (including connections establishing)
tps = 49348.107350 (excluding connections establishing)
* DB ON PORT 11000 *
transaction type: insert.sql
scaling factor: 1
query mode: simple
number of clients: 60
number of threads: 60
duration: 1800 s
number of transactions actually processed: 74015762
latency average = 1.459 ms
tps = 41119.829583 (including connections establishing)
tps = 41120.057764 (excluding connections establishing)