Re: pgbench - allow to specify scale as a size

From: Erik Rijkers <er(at)xs4all(dot)nl>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pgbench - allow to specify scale as a size
Date: 2018-02-17 11:30:14
Message-ID: 0908675d56b786b1148d2cc41d00cb4f@xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-02-17 13:48:24 Re: Disabling src/test/[ssl|ldap] when not building with SSL/LDAP support
Previous Message David Rowley 2018-02-17 09:39:40 Re: [HACKERS] path toward faster partition pruning