LoginSignup
6
6

More than 5 years have passed since last update.

cockroachdbでpgbenchを動かす

Last updated at Posted at 2016-03-13

忘れそうなのでメモ。
あと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 |
+----------+
6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6