I have schema with tables contains BLOBs.
I need to do some performance testing of it, and I need to generate some dummy data.
Is there any way to make MySQL user defined function that will return BLOB of random values with given size (for example first I want to test schema for 256KB BLOBs, later I want to test schema for 2MB BLOBs).
Performance of this function is not very important. I can wait to generate test data for some time. (But for reasonable time)
问问题
1393 次
1 回答
2
我碰巧最近需要类似的东西。因此,我创建了一个用于生成随机 BLOB 的 UDF。您可以在我的 github.com 帐户上找到它:
https://github.com/adrpar/mysql_udf_randomBlob
使用 cmake 编译并按照 README 文件中描述的后编译过程进行编译后,您可以像这样使用 UDF:
SELECT randomBlob( sizeOfBLOBInBytes);
例如对于 128 字节的 BLOB:
SELECT randomBlob( 128 );
或将其与您的INSERT
陈述结合起来。
于 2013-06-26T12:19:59.843 回答