On 2018-02-17 10:20, Fabien COELHO wrote:
After Karel Moppel piece on pgbench scale/size conversion, it occured
to me that having this as an option would be nice.
https://www.cybertec-postgresql.com/en/a-formula-to-calculate-pgbench-scaling-factor-for-target-db-size/
Here is a attempt at extending --scale so that it can be given a size.
pgbench -i --scale=124G ...
The approximated database size is also shown in the end-of-run summary.
[pgbench-scale-size-1.patch]
Seem a nice addition but something isn't quite right; with '-s 50' (no
unit) I get: 'scale 50 too small':
$ pgbench -is 50
scale 50 too small, rounded to 1
dropping old tables...
creating tables...
generating data...
100000 of 100000 tuples (100%) done (elapsed 0.13 s, remaining 0.00 s)
vacuuming...
creating primary keys...
done.
echo '\dti+ pgbench_accounts*' | psql -qX
List of relations
Schema | Name | Type | Owner | Table |
Size | Description
--------+-----------------------+-------+----------+------------------+---------+-------------
public | pgbench_accounts | table | aardvark | |
13 MB |
public | pgbench_accounts_pkey | index | aardvark | pgbench_accounts |
2208 kB |
(2 rows)
thanks,
Erik Rijkers