Examples of usedDistinctScan()


Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());

    assertRowCount(1, s.executeQuery("select distinct c2 from t1 where c3 = '1' and c1 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());

    // ordered, but no where clause - uses distinct scan
    // the following approach is used because the ordering of the results from
    // the distinct is not guaranteed (it varies depending on the JVM hash
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

    // file for all JVM's.
   
    s.execute("create table temp_result (result_column int)");
    s.execute("insert into temp_result (select distinct c1 from t1)");
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.usedDistinctScan());
    assertRowCount(4, s.executeQuery("select * from temp_result order by result_column"));
   
    // test distinct with an order by
    assertRowCount(4, s.executeQuery("select distinct c1 from t1 order by c1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

    assertRowCount(4, s.executeQuery("select * from temp_result order by result_column"));
   
    // test distinct with an order by
    assertRowCount(4, s.executeQuery("select distinct c1 from t1 order by c1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());   
   
      s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0)");
      s.execute("drop table temp_result");
    s.execute("drop table t1");
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

        expRS = new String[][] { { "2", "1" }, { "4", "2" }, { "6", "3" },
                { "8", "4" } };

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1"));
        assertTrue("Expected distinct scan  T3", p.usedDistinctScan("T3"));
   
      
      
        rs = st
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

                { "8", "4" } };

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1"));
        assertTrue("Expected distinct scan  T3", p.usedDistinctScan("T3"));
   
      
      
        rs = st
                .executeQuery("select x1.j, x2.b from (select distinct i,j from "
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

        expRS = new String[][] { { "2", "1" }, { "2", "1" }, { "4", "2" },
                { "4", "2" }, { "6", "3" }, { "6", "3" }, { "8", "4" },
                { "8", "4" }};
        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1"));
        assertTrue("Expected distinct scan  T2", p.usedDistinctScan("T2"));
        assertTrue("Expected distinct scan on T3", p.usedDistinctScan("T3"));
        assertTrue("Expected distinct scan  T4", p.usedDistinctScan("T4"));
  
        // Multiple subqueries that are UNIONs. Outer-most
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

                { "4", "2" }, { "6", "3" }, { "6", "3" }, { "8", "4" },
                { "8", "4" }};
        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1"));
        assertTrue("Expected distinct scan  T2", p.usedDistinctScan("T2"));
        assertTrue("Expected distinct scan on T3", p.usedDistinctScan("T3"));
        assertTrue("Expected distinct scan  T4", p.usedDistinctScan("T4"));
  
        // Multiple subqueries that are UNIONs. Outer-most
        // predicate X0.b = X2.j can be pushed to union X0 but NOT
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

                { "8", "4" }};
        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1"));
        assertTrue("Expected distinct scan  T2", p.usedDistinctScan("T2"));
        assertTrue("Expected distinct scan on T3", p.usedDistinctScan("T3"));
        assertTrue("Expected distinct scan  T4", p.usedDistinctScan("T4"));
  
        // Multiple subqueries that are UNIONs. Outer-most
        // predicate X0.b = X2.j can be pushed to union X0 but NOT
        // to subquery X2. Inner predicate T6.p = X1.i is eligible
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected distinct scan on T1", p.usedDistinctScan("T1"));
        assertTrue("Expected distinct scan  T2", p.usedDistinctScan("T2"));
        assertTrue("Expected distinct scan on T3", p.usedDistinctScan("T3"));
        assertTrue("Expected distinct scan  T4", p.usedDistinctScan("T4"));
  
        // Multiple subqueries that are UNIONs. Outer-most
        // predicate X0.b = X2.j can be pushed to union X0 but NOT
        // to subquery X2. Inner predicate T6.p = X1.i is eligible
        // for being pushed into union X1. In this case outer
View Full Code Here

Examples of org.apache.derbyTesting.junit.RuntimeStatisticsParser.usedDistinctScan()

                 {"12", "rrrr"} };                    
    stmt.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");     
    JDBC.assertFullResultSet(stmt.executeQuery("select i, b from t3 FOR UPDATE"), expectedValues);
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(stmt);
    assertTrue(rtsp.usedTableScan());
    assertFalse(rtsp.usedDistinctScan());
    commit();

    PreparedStatement p = prepareStatement("select i, b from t3  where i = ? FOR UPDATE");
                p.setString(1, "7");
                p.executeQuery();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.