提交 e725ed9d authored 作者: Thomas Mueller's avatar Thomas Mueller

Formatting

上级 ba44962f
...@@ -260,7 +260,6 @@ public abstract class TestBase { ...@@ -260,7 +260,6 @@ public abstract class TestBase {
return name; return name;
} }
if (admin) { if (admin) {
; // TODO testing
// name = addOption(name, "RETENTION_TIME", "10"); // name = addOption(name, "RETENTION_TIME", "10");
// name = addOption(name, "WRITE_DELAY", "10"); // name = addOption(name, "WRITE_DELAY", "10");
} }
......
...@@ -1628,7 +1628,7 @@ public class TestFunctions extends TestBase implements AggregateFunction { ...@@ -1628,7 +1628,7 @@ public class TestFunctions extends TestBase implements AggregateFunction {
assertResult("abc", stat, "SELECT TO_CHAR('abc') FROM DUAL"); assertResult("abc", stat, "SELECT TO_CHAR('abc') FROM DUAL");
conn.close(); conn.close();
} }
private void testGenerateSeries() throws SQLException { private void testGenerateSeries() throws SQLException {
Connection conn = getConnection("functions"); Connection conn = getConnection("functions");
......
...@@ -669,17 +669,20 @@ public class TestOptimizations extends TestBase { ...@@ -669,17 +669,20 @@ public class TestOptimizations extends TestBase {
assertTrue(plan.indexOf("TYPE_INDEX") > 0); assertTrue(plan.indexOf("TYPE_INDEX") > 0);
conn.close(); conn.close();
} }
private void testUseIndexWhenAllColumnsNotInOrderBy() throws SQLException { private void testUseIndexWhenAllColumnsNotInOrderBy() throws SQLException {
deleteDb("optimizations"); deleteDb("optimizations");
Connection conn = getConnection("optimizations"); Connection conn = getConnection("optimizations");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("CREATE TABLE test(id INT PRIMARY KEY, account INT, txid INT);"); stat.execute("create table test(id int primary key, account int, tx int)");
stat.execute("INSERT INTO test SELECT x, x*100, x FROM SYSTEM_RANGE(1, 10000);"); stat.execute("insert into test select x, x*100, x from system_range(1, 10000)");
stat.execute("ANALYZE SAMPLE_SIZE 5"); stat.execute("analyze sample_size 5");
stat.execute("CREATE UNIQUE INDEX idx_test_account_txid ON test(account, txid DESC);"); stat.execute("create unique index idx_test_account_tx on test(account, tx desc)");
ResultSet rs; ResultSet rs;
rs = stat.executeQuery("EXPLAIN ANALYZE SELECT txid FROM test WHERE account=22 AND txid<9999999 ORDER BY txid DESC LIMIT 25"); rs = stat.executeQuery("explain analyze " +
"select tx from test " +
"where account=22 and tx<9999999 " +
"order by tx desc limit 25");
rs.next(); rs.next();
String plan = rs.getString(1); String plan = rs.getString(1);
assertContains(plan, "index sorted"); assertContains(plan, "index sorted");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论