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

The selectivity of LOB columns is no longer calculated because indexes on LOB…

The selectivity of LOB columns is no longer calculated because indexes on LOB columns are not supported.
上级 029f597d
...@@ -39,6 +39,7 @@ public class TestOptimizations extends TestBase { ...@@ -39,6 +39,7 @@ public class TestOptimizations extends TestBase {
public void test() throws Exception { public void test() throws Exception {
deleteDb("optimizations"); deleteDb("optimizations");
testAnalyzeLob();
testLike(); testLike();
testExistsSubquery(); testExistsSubquery();
testQueryCacheConcurrentUse(); testQueryCacheConcurrentUse();
...@@ -69,6 +70,30 @@ public class TestOptimizations extends TestBase { ...@@ -69,6 +70,30 @@ public class TestOptimizations extends TestBase {
deleteDb("optimizations"); deleteDb("optimizations");
} }
private void testAnalyzeLob() throws Exception {
Connection conn = getConnection("optimizations");
Statement stat = conn.createStatement();
stat.execute("create table test(v varchar, b binary, cl clob, bl blob) as " +
"select ' ', '00', ' ', '00' from system_range(1, 100)");
stat.execute("analyze");
ResultSet rs = stat.executeQuery("select column_name, selectivity " +
"from information_schema.columns where table_name='TEST'");
rs.next();
assertEquals("V", rs.getString(1));
assertEquals(1, rs.getInt(2));
rs.next();
assertEquals("B", rs.getString(1));
assertEquals(1, rs.getInt(2));
rs.next();
assertEquals("CL", rs.getString(1));
assertEquals(100, rs.getInt(2));
rs.next();
assertEquals("BL", rs.getString(1));
assertEquals(100, rs.getInt(2));
stat.execute("drop table test");
conn.close();
}
private void testLike() throws Exception { private void testLike() throws Exception {
Connection conn = getConnection("optimizations"); Connection conn = getConnection("optimizations");
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论