Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

cockroachdbでpgbenchを動かす

忘れそうなのでメモ。
あと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 |
+----------+
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
6
Help us understand the problem. What are the problem?