提交 87846f08 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Reduce memory consumption by TestOptimizations in memory mode

上级 3cbbfcab
......@@ -1157,11 +1157,12 @@ public class TestOptimizations extends TestDb {
"FOREIGN KEY (table_a_id) REFERENCES TABLE_A(id) )");
stat.execute("INSERT INTO TABLE_A (name) SELECT 'package_' || CAST(X as VARCHAR) " +
"FROM SYSTEM_RANGE(1, 100) WHERE X <= 100");
int count = config.memory ? 30_000 : 50_000;
stat.execute("INSERT INTO TABLE_B (table_a_id, createDate) SELECT " +
"CASE WHEN table_a_id = 0 THEN 1 ELSE table_a_id END, createDate " +
"FROM ( SELECT ROUND((RAND() * 100)) AS table_a_id, " +
"DATEADD('SECOND', X, NOW()) as createDate FROM SYSTEM_RANGE(1, 50000) " +
"WHERE X < 50000 )");
"DATEADD('SECOND', X, NOW()) as createDate FROM SYSTEM_RANGE(1, " + count + ") " +
"WHERE X < " + count + " )");
stat.execute("CREATE INDEX table_b_idx ON table_b(table_a_id, id)");
stat.execute("ANALYZE");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论