这篇文章主要介绍“怎么使用PostgreSQL中的benchmarksql”,在日常操作中,相信很多人在怎么使用PostgreSQL中的benchmarksql问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”怎么使用PostgreSQL中的benchmarksql”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

benchmarksql是一款使用Java开发的测试工具.
安装使用相对比较简单,下载解压到安装目录

cd/home/pg12/software/benchmarksql-4.1.1/run

配置参数,修改配置文件props.pg

#############################################[pg12@localhostrun]$catprops.pg//数据库连接信息driver=org.postgresql.Driverconn=jdbc:postgresql://192.168.26.28:5440/benchmarkdbuser=pg12password=pg12//多少仓warehouses=100//并发数terminals=20//Torunspecifiedtransactionsperterminal-runMinsmustequalzerorunTxnsPerTerminal=0//Torunforspecifiedminutes-runTxnsPerTerminalmustequalzero//这是运行时间runMins=10//NumberoftotaltransactionsperminutelimitTxnsPerMin=0//Thefollowingfivevaluesmustaddupto100//Thedefaultpercentagesof45,43,4,4&4matchtheTPC-CspecnewOrderWeight=45paymentWeight=43orderStatusWeight=4deliveryWeight=4stockLevelWeight=4

创建数据表&索引(100仓的数据)

#############################################./runSQL.shprops.pgsqlTableCreates./runLoader.shprops.pgnumwarehouses32./runSQL.shprops.pgsqlIndexCreates

执行测试

./runBenchmark.shprops.pg#1...2019-08-2716:30:33,025INFO-Term-00,MeasuredtpmC(NewOrders)=7527.022019-08-2716:30:33,025INFO-Term-00,MeasuredtpmTOTAL=16752.672019-08-2716:30:33,025INFO-Term-00,SessionStart=2019-08-2716:20:322019-08-2716:30:33,025INFO-Term-00,SessionEnd=2019-08-2716:30:332019-08-2716:30:33,025INFO-Term-00,TransactionCount=167552#2...2019-08-2717:30:27,264INFO-Term-00,MeasuredtpmC(NewOrders)=5879.052019-08-2717:30:27,264INFO-Term-00,MeasuredtpmTOTAL=13086.972019-08-2717:30:27,264INFO-Term-00,SessionStart=2019-08-2717:20:202019-08-2717:30:27,265INFO-Term-00,SessionEnd=2019-08-2717:30:272019-08-2717:30:27,265INFO-Term-00,TransactionCount=132408

到此,关于“怎么使用PostgreSQL中的benchmarksql”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!