忘れそうなのでメモ。
あとpgbenchはPostgreSQLに入ってるpgbenchではないです。
- pgbenchをbuild
$ cd $GOPATH/src/github.com/cockroachdb/cockroach/sql/pgbench/cmd/pgbenchsetup
$ go build -o pgbench main.go
- 初期データをロード
データベース(hogeデータベース)を新規に作成して、10000件をロード。
$ ./pgbench -createdb -accounts 10000 postgresql://root@127.0.0.1:26257/hoge?sslmode=disable
Inserted 1 branch records
Inserted 10 teller records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 5000 account records
Inserted 10 history records
- 確認
$ ./cockroachdb sql --insecure -d hoge
root@:26257> select count(*) from pgbench_accounts;
+----------+
| count(*) |
+----------+
| 10000 |
+----------+