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

Formatting

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