Scale detection

The number of branches is referred to as the database scale, with each branch adding another 10 tellers and 100,000 accounts to the database. This value is input when you initialize the database pgbench is told to create tables into. Here's an example that creates a database for pgbench and then populates it with the pgbench tables:

$ createdb pgbench 
$ pgbench -i -s 10 pgbench 

This will initialize (-i), the pgbench tables using a scale of 10 (-s 10) into the database named pgbench. You don't have to use that name, but it's a common convention.

When pgbench runs in a regular mode (not initialization), it first checks whether you have manually told it the database scale using -s; if so, it uses that value. If not, and you're ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.