开发者

How can I make each row in the resultset returns multiple times?

开发者 https://www.devze.com 2023-03-04 09:03 出处:网络
I\'m writing an application that uses Mysql and for now my tables don\'t have many data in it. I want to test how my application handles a larger amount of data. In order to d开发者_如何学运维o that I

I'm writing an application that uses Mysql and for now my tables don't have many data in it. I want to test how my application handles a larger amount of data. In order to d开发者_如何学运维o that I need each row in the resultset to repeat itself several times.

I know that I can run the query and UNION it with the same query and UNION that with the same query. Is there a different way that makes it easier for me to choose how many duplications will occur?


Make sure you have a table to insert into

To generate dummy data. http://www.generatedata.com This will generate the data as well as the insert scripts.

Then Just create a massive dataset


You could do a cross join on itself, which would yield 2^n results, but it's all going to be dirty hacks

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号