工具-sqlbench

sqlbench有两种,一个支持oltp测试,一个支持查询语句对比的。

https://github.com/felixge/sqlbench这个是支持查询语句对比的github。

安装

在这里下载
https://github.com/felixge/sqlbench/releases

安装的时候如下报错:
go build
go: github.com/jackc/pgx/v4@v4.8.1: Get "https://proxy.golang.org/github.com/jackc/pgx/v4/@v/v4.8.1.mod": dial tcp 142.251.42.241:443: i/o timeout
go: downloading github.com/montanaflynn/stats v0.6.3
go: downloading github.com/olekukonko/tablewriter v0.0.4
go: downloading github.com/jackc/pgx/v4 v4.8.1
go: github.com/jackc/pgx/v4@v4.8.1: Get "https://proxy.golang.org/github.com/jackc/pgx/v4/@v/v4.8.1.mod": dial tcp 142.251.42.241:443: i/o timeout

 
搜了一下,可以调整一下go proxy代理,详见-》https://blog.csdn.net/m0_67393413/article/details/126100779,亲测可行:
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GOSUMDB=off
go env -w GOSUMDB=sum.golang.google.cn

本来想用于mysql测试的,然后github 的readme显示:

Only PostgreSQL is supported at this point, but pull requests for MySQL or other databases are welcome.

放弃吧。但功能是挺好的,要是支持mysql就很完美了。

支持sql之间的对比。

 

 

有时间可以研究一下源码。

这个是postgreSQL的测试示例,https://blog.csdn.net/weixin_44519342/article/details/122827534 

sqlbench的资料还是比较少的。

posted on 2023-03-23 15:09  Y.Debby  阅读(84)  评论(0)    收藏  举报