Examples of eliminatedDuplicates()


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

     
    // first column of an index
    assertRowCount(4, s.executeQuery("select distinct c1 from t1 where 1=1"));
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());

    // equality predicate on preceding key columns
    assertRowCount(1, s.executeQuery("select distinct c2 from t1 where c1 = 1 and c3 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
View Full Code Here

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

    // equality predicate on preceding key columns
    assertRowCount(1, s.executeQuery("select distinct c2 from t1 where c1 = 1 and c3 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());
   
    // equality predicate on all key columns, non unique
    assertRowCount(1, s.executeQuery("select distinct c3 from t1 where c1 = 1 and c2 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
View Full Code Here

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

   
    // equality predicate on all key columns, non unique
    assertRowCount(1, s.executeQuery("select distinct c3 from t1 where c1 = 1 and c2 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());
   
    // equality predicate on all key columns, non unique
    assertRowCount(1, s.executeQuery("select distinct c3 from t2 where c1 = 1 and c2 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
View Full Code Here

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

   
    // equality predicate on all key columns, non unique
    assertRowCount(1, s.executeQuery("select distinct c3 from t2 where c1 = 1 and c2 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertFalse(rtsp.eliminatedDuplicates());
   
    // different orderings
    assertRowCount(6, s.executeQuery("select distinct c2, c1 from t1 where 1=1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
View Full Code Here

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

   
    // different orderings
    assertRowCount(6, s.executeQuery("select distinct c2, c1 from t1 where 1=1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());

    assertRowCount(2, s.executeQuery("select distinct c2 from t1 where c1 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertTrue(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertTrue(rtsp.eliminatedDuplicates());

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

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

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

    assertTrue(rtsp.eliminatedDuplicates());

    assertRowCount(1, s.executeQuery("select distinct c2, c1 from t1 where c3 = '1'"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    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());
View Full Code Here

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

    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
    // implementation), but adding an order by to the query may
View Full Code Here

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

   
    // 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");
    s.execute("drop table t2");
View Full Code Here

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

   
    // more than one table in the select list
    // Following runtime statistics output should have Eliminate duplicates = true
    assertRowCount(3, s.executeQuery("select distinct a.c1, b.c1 from one a, two b where a.c1 = b.c1 and b.c2 =1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates())
   
    // cross product join
    assertRowCount(8, s.executeQuery("select distinct a.c1 from one a, two b"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates())
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.