benchmarksql详解及支持mysql、达梦、citus的lightdb benchmarksql分支

  官网:https://sourceforge.net/projects/benchmarksql/,github:官方文档https://benchmarksql.readthedocs.io/en/latest/

  为什么使用benchmarksql压测?因为大多数应用系统使用java开发,并且不使用存储过程,故使用benchmarksql压测数据库最公平,既可以测试数据库,也可以测试JDBC驱动。

  可以用来测试EnterpriseDB, PostgreSQL, Oracle, Sybase, SQLSvr, MySQL, HsqlDB, Derby/JavaDB & FireBird。

  其模型ER关系图如下:

  

   共有5个事务组成,分别如下:

This schema is used by 5 different transactions that produce a variety of different access patterns on the tables.

  • Item is read only.
  • WarehouseDistrictCustomer and Stock are read/write.
  • New-Order is insert, read and delete, like a queue that at any given time has approximately W * 9000 rows in it.
  • Order and Order-Line receive inserts and every row inserted will have a time delayed update to it, after which the row becomes stale and may be read infrequently in the future.
  • History is insert only.

    在分布式版本中,item和config表适合作为广播表,其他表跟着warehouse的分片走。

  Order逻辑由4个SELECT3个INSERT,2个UPDATE组成,和在微服务中不用匿名块和存储过程实现的逻辑高度匹配。具体可见http://tpc.org/tpc_documents_current_versions/pdf/tpc-c_v5.11.0.pdf 108页。

  所以benchmarksql跑的时间越长,数据库也会越大。一般来说当数据库大小超过数据库共享缓存的3倍后,性能就会开始明显的下降。

  虽然国内生产实践中已经很少使用外键约束,但是benchmarksql的实现,仍然广泛的采用了外键约束以符合TPC-C的要求。

  注:benchmarksql原生不支持mysql,https://github.com/hslightdb/benchmarksql增加了一个支持mysql的版本,同时在此基础上增加了对postgresql citus分布式、tpch for citus(60%默认失败)、达梦数据库的支持。pgsql-io维护的是linux的原地更新模式

  编译可参见 ant https://github.com/hslightdb/citus-benchmarksql/blob/master/HOW-TO-RUN.txt

  https://benchmarksql.readthedocs.io/en/latest/

posted @ 2022-01-28 21:10  zhjh256  阅读(1071)  评论(0编辑  收藏  举报