请帮我澄清一下,如果pgbench工具可以并行地执行我自己的sql场景?谷歌搜索和本地搜索没有带来积极的结果。
我运行的脚本没有错误。但在执行后,我没有看到任何迹象,我的脚本实际上已经被执行。pgbench是否与我的sql脚本提交事务?
这是我得到的输出:
C:\Program Files\PostgreSQL\9.2\bin>pgbench.exe -n -h dbserverhost -U postgres -
T 10 -c 64 -j 8 bench_dbname -f c:\Dev\bench_script.sql
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 64
number of threads: 8
duration: 10 s
number of transactions actually processed: 1020
tps = 95.846561 (including connections establishing)
tps = 103.387127 (excluding connections establishing)
C:\Program Files\PostgreSQL\9.2\bin>script bench_script.sql是:
--comment here
begin;
insert into schm.log values ( 'pgbench test', current_timestamp );
end;溶液
pgBench Windows版本对传递给实用程序的论证顺序非常敏感:"bench_dbname“参数必须是行中的最后一个参数。
这是pgbench Windows版本命令行的正确示例:
pgbench.exe -d -r -h 127.0.0.1 -U postgres -T 5 -f C:\Dev\bench_script.sql -c 64 -j 8 postgres对我来说,最有用的论据是:
pgBench官方文件
PgBench,我爱你!:)
祝大家万事如意;)
发布于 2013-08-01 20:26:46
"transaction type: TPC(某种程度的)“意味着它没有处理-f选项来运行自定义的sql脚本,而是运行默认的查询。
在Windows版本中,getopt似乎在到达不以连字符开头的第一个选项(即"bench_dbname“)时停止解析这些选项。所以,确保-f在此之前就出现了。
发布于 2020-10-30 12:56:28
我想只要您使用自定义脚本,您还需要-n选项吗?
-n -无真空 在运行测试之前不执行清空操作。如果您正在运行不包括标准表pgbench_accounts、pgbench_branches、pgbench_history和pgbench_tellers的自定义测试场景,则此选项是必要的。
https://stackoverflow.com/questions/17997070
复制相似问题