How to Intentionally Create a Long-Running MySQL Query
I assume you could use benchmark()
for this, although that isn't the scope of it.
select benchmark(9999999999, md5('when will it end?'));
If you need them to run for a bit, but not that long, then try
select benchmark(1000000, md5('when will it end?')); -- around 0.3s
select benchmark(10000000, md5('when will it end?')); -- around 3s
select benchmark(100000000, md5('when will it end?')); -- around 30s