Criando tabelas para Benchmark no PostgreSQL

O programa pgbench, que faz parte do contrib do PostgreSQL, cria 4 tabelas para um teste de Benchmark compatível com TPC-B.

Como eu compilei o PostgreSQL (versão 9.1.1) a partir do código fonte, precisei especificar a inclusão dos programas contrib no momento da compilação, utilizando gmake world e gmake install-world ao invés de gmake e gmake install. Estes detalhes estão no arquivo INSTALL do diretório do código fonte.

As opções -F (Fill Factor) e -s ditam qual será o tamanho da tabela.

Manual do pgbench: http://www.postgresql.org/docs/9.1/static/pgbench.html

postgres@PostgreSQL:~$ /usr/local/pgsql/bin/createdb test
postgres@PostgreSQL:~$ /usr/local/pgsql/bin/pgbench -i test -F 99 -s 10
NOTICE:  table "pgbench_branches" does not exist, skipping
NOTICE:  table "pgbench_tellers" does not exist, skipping
NOTICE:  table "pgbench_accounts" does not exist, skipping
NOTICE:  table "pgbench_history" does not exist, skipping
creating tables...
10000 tuples done.
20000 tuples done.
30000 tuples done.
40000 tuples done.
50000 tuples done.
60000 tuples done.
70000 tuples done.
80000 tuples done.
90000 tuples done.
100000 tuples done.
110000 tuples done.
120000 tuples done.
130000 tuples done.
140000 tuples done.
150000 tuples done.
160000 tuples done.
170000 tuples done.
180000 tuples done.
190000 tuples done.
200000 tuples done.
210000 tuples done.
220000 tuples done.
230000 tuples done.
240000 tuples done.
250000 tuples done.
260000 tuples done.
270000 tuples done.
280000 tuples done.
290000 tuples done.
300000 tuples done.
310000 tuples done.
320000 tuples done.
330000 tuples done.
340000 tuples done.
350000 tuples done.
360000 tuples done.
370000 tuples done.
380000 tuples done.
390000 tuples done.
400000 tuples done.
410000 tuples done.
420000 tuples done.
430000 tuples done.
440000 tuples done.
450000 tuples done.
460000 tuples done.
470000 tuples done.
480000 tuples done.
490000 tuples done.
500000 tuples done.
510000 tuples done.
520000 tuples done.
530000 tuples done.
540000 tuples done.
550000 tuples done.
560000 tuples done.
570000 tuples done.
580000 tuples done.
590000 tuples done.
600000 tuples done.
610000 tuples done.
620000 tuples done.
630000 tuples done.
640000 tuples done.
650000 tuples done.
660000 tuples done.
670000 tuples done.
680000 tuples done.
690000 tuples done.
700000 tuples done.
710000 tuples done.
720000 tuples done.
730000 tuples done.
740000 tuples done.
750000 tuples done.
760000 tuples done.
770000 tuples done.
780000 tuples done.
790000 tuples done.
800000 tuples done.
810000 tuples done.
820000 tuples done.
830000 tuples done.
840000 tuples done.
850000 tuples done.
860000 tuples done.
870000 tuples done.
880000 tuples done.
890000 tuples done.
900000 tuples done.
910000 tuples done.
920000 tuples done.
930000 tuples done.
940000 tuples done.
950000 tuples done.
960000 tuples done.
970000 tuples done.
980000 tuples done.
990000 tuples done.
1000000 tuples done.
set primary key...
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "pgbench_branches_pkey" for table "pgbench_branches"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "pgbench_tellers_pkey" for table "pgbench_tellers"
NOTICE:  ALTER TABLE / ADD PRIMARY KEY will create implicit index "pgbench_accounts_pkey" for table "pgbench_accounts"
vacuum...done.

Leave a Reply

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Esse site utiliza o Akismet para reduzir spam. Aprenda como seus dados de comentários são processados.