Examples of usedSpecificIndexForIndexScan()


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

            if (expectedScan.equals("Table"))
                    assertTrue(rtsp.usedTableScan());
            else if (expectedScan.equals("Index"))
            {
                assertTrue(rtsp.usedIndexScan());
                assertTrue(rtsp.usedSpecificIndexForIndexScan(
                        expTableInIndexScan, expIndexInIndexScan));
            }
            else if (expectedScan.equals("Constraint"))
            {
                assertTrue(rtsp.usedIndexScan());
View Full Code Here

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

    ps = prepareStatement("SELECT * FROM t2 WHERE c21=? AND c22=?");
      ps.setInt(1, 0);
        ps.setString(2, "Tuple 4");
        JDBC.assertDrainResults(ps.executeQuery());
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.usedSpecificIndexForIndexScan("T2","T2I1"));

    //Running the update statistics below will create statistics for T2I2
    s.execute("CALL SYSCS_UTIL.SYSCS_UPDATE_STATISTICS('APP','T2','T2I2')");
        stats.assertIndexStats("T2I2", 1);

View Full Code Here

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

        //Rerunning the query "SELECT * FROM t2 WHERE c21=? AND c22=?" and
        //looking at it's plan will show that this time it picked up more
        //efficient index which is T2I2.
        JDBC.assertDrainResults(ps.executeQuery());
    rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.usedSpecificIndexForIndexScan("T2","T2I2"));
        //cleanup
        s.executeUpdate("DROP TABLE t2");
        //End of test case for better index selection after statistics
        //availability
        stats.release();
View Full Code Here

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

        "ORDER BY m0.value";

        s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
        ResultSet rs = s.executeQuery(sql1);
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.usedSpecificIndexForIndexScan("TABLE2","KEY3"));
    assertTrue(rtsp.whatSortingRequired());
 
        rs = s.executeQuery(sql1);
        String[][] result = {
                {"4294967297", "000001", "21857"},
View Full Code Here

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

    s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
        ResultSet rs = s.executeQuery(sql1);
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(
        s);
    assertTrue(rtsp.usedSpecificIndexForIndexScan("TABLE2","KEY3"));
    assertTrue(rtsp.whatSortingRequired());

    rs = s.executeQuery(sql1);
        String[][] result = {
                {"4294967297", "000001", "21857"},
View Full Code Here

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

        "ORDER BY m0.value";

        s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
        ResultSet rs = s.executeQuery(sql1);
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
    assertTrue(rtsp.usedSpecificIndexForIndexScan("TABLE2","KEY3"));
    assertTrue(rtsp.whatSortingRequired());
 
        rs = s.executeQuery(sql1);
        String[][] result = {
                {"4294967297", "000001", "21857"},
View Full Code Here

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

    s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1)");
        ResultSet rs = s.executeQuery(sql1);
    RuntimeStatisticsParser rtsp = SQLUtilities.getRuntimeStatisticsParser(
        s);
    assertTrue(rtsp.usedSpecificIndexForIndexScan("TABLE2","KEY3"));
    assertTrue(rtsp.whatSortingRequired());

    rs = s.executeQuery(sql1);
        String[][] result = {
                {"4294967297", "000001", "21857"},
View Full Code Here

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

                "test, template --DERBY-PROPERTIES joinStrategy=nestedLoop, " +
                "index=template_two \n" +
                "where test.two = template.two").close();
        checkEstimatedRowCount(conn,8020012.5);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TEMPLATE", "TEMPLATE_TWO"));
       
        // do joins on 20
        // first NL
        // join on twenty. template inner, NL, index=template_twenty, all rows.
        s.executeQuery("select template.id from " +
View Full Code Here

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

                "index=template_twenty \n" +
                "where test.twenty = template.twenty").close();
        // Rowcount should be same as testSingleColumnSelectivityHash
        checkEstimatedRowCount(conn,802001.25);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TEMPLATE", "TEMPLATE_TWENTY"));
       
        // join on 20 but use index 20_2
        // cost as well as selectivity should be divided using selectivity
        // cost should same as template_twenty, or just a shade more...
        // join on twenty. template inner, NL, index=template_22, all rows
View Full Code Here

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

                "test, template --DERBY-PROPERTIES joinStrategy=nestedLoop, " +
                "index=template_22 \n" +
                "where test.twenty = template.twenty").close();
        checkEstimatedRowCount(conn,802001.25);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TEMPLATE", "TEMPLATE_22"));
       
        // join on twenty but no index
        // note: the original test had this comment:
        // 'rc should be divided using selectivity. cost should be way different'
        // however, it seems the ec is identical.
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.