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 as insert-size.sql
):
insert into data (filler) values (repeat('X',:scale));
This borrows the concept of "scale" from the regular tests and uses it to specify the size of the data inserted. You can create your own variables with other names, pass values for them on the command line, and then refer to them in your scripts.
Here's a sample session showing installation of this test using the sample version included with pgbench-tools
, followed by manually...