Examples of eliminatedDuplicates()


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

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

    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())
   
    // no single table will yield at most 1 row
    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3, a.c2 from two a, two b where a.c1 = b.c1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertTrue(rtsp.eliminatedDuplicates())
   
    // no single table will yield at most 1 row
    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3, a.c2 from two a, two b where a.c1 = b.c1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3, a.c2 from two a, two b where a.c1 = b.c1 and a.c2 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
   
    // both keys from unique index in where clause but joined to different tables
View Full Code Here

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

    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3, a.c2 from two a, two b where a.c1 = b.c1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3, a.c2 from two a, two b where a.c1 = b.c1 and a.c2 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
   
    // both keys from unique index in where clause but joined to different tables
    assertRowCount(1, s.executeQuery("select distinct a.c1 from one a, two b, three c where a.c1 = b.c1 and c.c1 = b.c3 and a.c1 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertTrue(rtsp.eliminatedDuplicates());
   
    // both keys from unique index in where clause but joined to different tables
    assertRowCount(1, s.executeQuery("select distinct a.c1 from one a, two b, three c where a.c1 = b.c1 and c.c1 = b.c3 and a.c1 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
   
    // join between two tables using one columns of unique key
    assertRowCount(3, s.executeQuery("select distinct a.c1 from two a, four b where a.c1 = b.c1 and b.c3 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertTrue(rtsp.eliminatedDuplicates());
   
    // join between two tables using one columns of unique key
    assertRowCount(3, s.executeQuery("select distinct a.c1 from two a, four b where a.c1 = b.c1 and b.c3 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
   
    // join between two tables with no join predicate
    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3 from two a, one b"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertTrue(rtsp.eliminatedDuplicates());
   
    // join between two tables with no join predicate
    assertRowCount(9, s.executeQuery("select distinct a.c1, a.c3 from two a, one b"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());

    // join between three tables with two tables joined uniquely
    assertRowCount(1, s.executeQuery("select distinct a.c1 from one a, two b, three c where a.c1 = c.c1 and a.c1 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertTrue(rtsp.eliminatedDuplicates());

    // join between three tables with two tables joined uniquely
    assertRowCount(1, s.executeQuery("select distinct a.c1 from one a, two b, three c where a.c1 = c.c1 and a.c1 = 1"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.eliminatedDuplicates());
   
    // queries that should eliminate the distinct
    // Following runtime statistics output should NOT have Eliminate duplicates = true
    // single table queries
    // unique columns in select list
View Full Code Here

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

    // single table queries
    // unique columns in select list
    assertRowCount(8, s.executeQuery("select distinct c1 from one"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertFalse(rtsp.eliminatedDuplicates());
   
    assertRowCount(8, s.executeQuery("select distinct c1, c2 + c3 from one"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertFalse(rtsp.eliminatedDuplicates());
View Full Code Here

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

    assertFalse(rtsp.eliminatedDuplicates());
   
    assertRowCount(8, s.executeQuery("select distinct c1, c2 + c3 from one"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertFalse(rtsp.eliminatedDuplicates());

    assertRowCount(9, s.executeQuery("select distinct c3, c1 from two"));
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertFalse(rtsp.usedDistinctScan());
    assertFalse(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.