1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Allow pgbench to use a scale larger than 21474.

Beyond 21474, the number of accounts exceed the range for int4. Change the
initialization code to use bigint for account id columns when scale is large
enough, and switch to using int64s for the variables in pgbench code. The
threshold where we switch to bigints is set at 20000, because that's easier
to remember and document than 21474, and ensures that there is some headroom
when int4s are used.

Greg Smith, with various changes by Euler Taveira de Oliveira, Gurjeet
Singh and Satoshi Nagayasu.
This commit is contained in:
Heikki Linnakangas
2013-01-29 11:49:40 +02:00
parent c9d7dbacd3
commit 89d00cbe01
2 changed files with 128 additions and 32 deletions

View File

@ -185,6 +185,11 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
Multiply the number of rows generated by the scale factor.
For example, <literal>-s 100</> will create 10,000,000 rows
in the <structname>pgbench_accounts</> table. Default is 1.
When the scale is 20,000 or larger, the columns used to
hold account identifiers (<structfield>aid</structfield> columns)
will switch to using larger integers (<type>bigint</type>),
in order to be big enough to hold the range of account
identifiers.
</para>
</listitem>
</varlistentry>