O'Reilly logo

PostgreSQL 9.0 High Performance by Gregory Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

pgbench custom tests

While the built-in tests are interesting, you can use pgbench instead as a testing harness to run your own database tests. This gets you multiple clients running at once, executing concurrent queries with a minimum of scripting.

Insert speed test

To give an idea how this might be useful, imagine you want to test how fast your system can write data to disk using INSERT. You might copy the filler concept from the built-in tables, where you just want to create some strings with a particular length and therefore size in bytes, without caring about the content (this is included in pgbench-tools as init/insertsize.sql):

create table data(filler text);

But then create a custom script that actually fills that much space up (also included ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required