ページ更新: 2004-08-10 (火) (6744日前)
pgbench 動かしたかったので、Cygwin の PostgreSQL のを使ってみる。 (本来なら contrib の pgbench を自分でコンパイルしてみるべきだが、 MinGW の環境を整えてなかったので) [編集] Cygwin 版 pgbench に必要なファイル #$ which pgbench /usr/bin/pgbench $ cygcheck -f `which pgbench` postgresql-7.4.3-1 $ cygcheck `which pgbench`.exe C:/cygwin/bin/pgbench.exe C:/cygwin/bin\pq.dll C:/cygwin/bin\cygcrypt-0.dll C:/cygwin/bin\cygwin1.dll C:\WINDOWS\System32\ADVAPI32.DLL C:\WINDOWS\System32\ntdll.dll C:\WINDOWS\System32\KERNEL32.dll C:\WINDOWS\System32\RPCRT4.dll C:/cygwin/bin\cygcrypto-0.9.7.dll C:/cygwin/bin\cygssl-0.9.7.dll よって、次の6つが必要なファイル。 pgbench.exe pq.dll cygcrypt-0.dll cygcrypto-0.9.7.dll cygssl-0.9.7.dll cygwin1.dll[編集] pgbench 実行の準備 (PostgreSQL) #[編集]ユーザ追加 #この作業は必須ではないが、普段使うユーザを登録した方が楽そうなので。 C:\Program Files\PostgreSQL\8.0-beta1\bin> createuser -U postgres ★PostgreSQL のスーパーユーザ Enter name of user to add: username Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) n Password: ★postgres のパスワード CREATE USER[編集] データベース作成 #C:\Program Files\PostgreSQL\8.0-beta1\bin> createdb -U username bench Password: CREATE DATABASE[編集] pgbench #UNIX Domain Socket は使えない(だって、Windowsだもの)。 ちなみに、psql の場合、-h HOSTNAME を省略すると、localhost に Socket で接続 するようだ。 C:\Program Files\PostgreSQL\8.0-beta1\bin> psql --help | find "-h HOST" -h HOSTNAME database server host or socket directory (default: "local sock et") また、PostgreSQL をインストールすると、ちゃんと Socket は有効になっているので、 > netstat -a -n | find "5432" TCP 127.0.0.1:5432 0.0.0.0:0 LISTENING > pgbench -h localhost -P password -i bench 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. set primary key... NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "branches_pkey " for table "branches" NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "tellers_pkey" for table "tellers" NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "accounts_pkey " for table "accounts" vacuum...WARNING: skipping "pg_shadow" --- only table or database owner can vac uum it WARNING: skipping "pg_database" --- only table or database owner can vacuum it WARNING: skipping "pg_group" --- only table or database owner can vacuum it WARNING: skipping "pg_tablespace" --- only table or database owner can vacuum i t done. > pgbench -h localhost -P password bench starting vacuum...end. transaction type: TPC-B (sort of) scaling factor: 1 number of clients: 1 number of transactions per client: 10 number of transactions actually processed: 10/10 tps = 30.030030 (including connections establishing) tps = 38.022814 (excluding connections establishing) |