如何在 phpmyadmin 中多次运行查询?

我想要一种能够对查询进行 1,000,000 次基准测试的方法.什么是最简单的方法来做到这一点?目前我已经搜索了多次发出查询的方法,但没有弹出任何内容.

I want a way to be able to benchmark a query like 1,000,000 times. What's the easiest way to do this? Currently I've searched for a way to issue a query multiple times but nothing pops up.

我也遇到过可以在 mysql 命令行中运行的 benchmark() 命令,但它似乎有一些限制,我似乎无法让它工作.

I've also come across the benchmark() command that can be run in mysql command line, but it seems to have some limitations and I can't seem to get it to work.

推荐答案

这并不是 phpMyAdmin 的工作,它是面向 MySQL 初学者的 GUI.

This isn't really the job of phpMyAdmin, a GUI for MySQL beginners.

将查询放在一个脚本中,在一个循环中运行 1,000,000 次.

Put the query in a script, in a loop that runs 1,000,000 times.

虽然这不是一个很好的基准.如果您试图模拟真实需求,您需要有一些并发活动,而不仅仅是一次发出和返回 1,000,000 个查询.

Though that's not a very good benchmark of anything. If you're trying to simulate real demand, you need to have some concurrent activity, not just 1,000,000 queries issued and returned one at a time.

相关文章