mysql中行锁的基准测试
我正在尝试使用select..for update语句对sql事务进行基准测试,该语句对行使用独占锁,然后将行插入另一个表中,如下所示mysql中行锁的基准测试,mysql,benchmarking,amazon-aurora,Mysql,Benchmarking,Amazon Aurora,我正在尝试使用select..for update语句对sql事务进行基准测试,该语句对行使用独占锁,然后将行插入另一个表中,如下所示 START TRANSACTION; SELECT CurrentSize FROM testtable WHERE id = {id} FOR UPDATE; -- update current size in testtable UPDATE testtable SET currentsize = curr
START TRANSACTION;
SELECT CurrentSize
FROM testtable
WHERE id = {id} FOR UPDATE;
-- update current size in testtable
UPDATE testtable
SET currentsize = currentsize + 1
WHERE id = {id} ;
-- insert into a different table
insert into testtable2 values(1,2);
COMMIT;
我在上述交易中获得了2K tps,我假设每个交易需要0.5ms才能完成,因此我获得了2K tps
甚至可以将系统扩展到这一点之外吗?如果是的话,是否有任何我可以尝试使用的实现
我使用的是AWS RDS Aurora MySQL的一台16倍大的机器