Examples of usedSpecificIndexForIndexScan()


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

        // sorting.
        rs = s.executeQuery("select * from (select i from ts order by i)tt");
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);

        // Verify that we use the index scan here and no sorting is incurred
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TS","T_I"));
        assertFalse(rtsp.whatSortingRequired());

        s.execute("call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(0)");
        rollback();
    }
View Full Code Here

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

                "where t1.hundred = t2.hundred " +
                "and t2.two = t3.two " +
                "and t2.twenty = t3.twenty").close();
        checkEstimatedRowCount(conn,1.606007503125E7);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("T3", "T3_TWO_TWENTY"));
        assertTrue(rtsp.findString("Bit set of columns fetched={0, 1}", 1));
        assertTrue(rtsp.findString("Hash Scan ResultSet for T2", 1));
        assertTrue(rtsp.findString("Bit set of columns fetched={1, 2, 3}", 1));
        assertTrue(rtsp.findString("Hash Scan ResultSet for T1", 1));
        assertTrue(rtsp.findString("Bit set of columns fetched={0, 3}", 1));
View Full Code Here

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

                "where t1.hundred = t2.hundred " +
                "and t2.two = t3.two " +
                "and t2.twenty = t3.twenty").close();
        checkEstimatedRowCount(conn,1.606007503125E7);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("T3", "T3_TWO_TWENTY"));
        assertTrue(rtsp.findString("Bit set of columns fetched={0, 1}", 1));
        assertTrue(rtsp.findString("Table Scan ResultSet for T1", 1));
        assertTrue(rtsp.findString("Bit set of columns fetched={0, 3}", 1));
        assertTrue(rtsp.findString("Hash Scan ResultSet for T2", 1));
        assertTrue(rtsp.findString("Bit set of columns fetched={1, 2, 3}", 1));
View Full Code Here

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

                "where t1.hundred = t2.hundred " +
                "and t2.two = t3.two " +
                "and t2.twenty = t3.twenty").close();
        checkEstimatedRowCount(conn,6.4240300125000015E7);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("T3", "T3_TWO_TWENTY"));
        assertTrue(rtsp.findString("Bit set of columns fetched={0, 1}", 1));
        assertTrue(rtsp.findString("Table Scan ResultSet for T1", 1));
        assertTrue(rtsp.findString("Bit set of columns fetched={0, 3}", 1));
        assertTrue(rtsp.findString("Hash Scan ResultSet for T2", 1));
        assertTrue(rtsp.findString("Bit set of columns fetched={1, 2, 3}", 1));
View Full Code Here

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

                "--DERBY-PROPERTIES joinOrder=fixed \n" +
                "t1, scratch_table s " +
                "where t1.twenty = s.twenty").close();
        checkEstimatedRowCount(conn,1604002.5);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("T1", "T1_TWO_TWENTY"));
        assertTrue(rtsp.usedHashJoin());
       
        // preds are on column 2,3.
        // 0.01 -> 16*10.4
        s.executeQuery("select s.id from " +
View Full Code Here

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

                "t1, scratch_table s " +
                "where t1.twenty = s.twenty " +
                "and s.hundred = CAST(CHAR(t1.hundred) AS INTEGER)").close();
        checkEstimatedRowCount(conn,160400.2500000);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("T1", "T1_TWENTY_HUNDRED"));
        assertTrue(rtsp.usedHashJoin());
    }
   
    public void testStatMatcher() throws SQLException {
        // test of statistics matcher algorithm; make sure that we choose the
View Full Code Here

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

                "and t10.a = 2 " +
                "and t10.b = 2").close();
        checkEstimatedRowCount(conn,7945.920000000);
        RuntimeStatisticsParser rtsp =
                SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("COMPLEX", "COMPLEXIND"));
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TEMPLATE", "TEMPLATE_TWO"));
    }
   
    public void testBasic() throws SQLException {
        // basic test for update statistics; make sure that statistics with
View Full Code Here

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

                "and t10.b = 2").close();
        checkEstimatedRowCount(conn,7945.920000000);
        RuntimeStatisticsParser rtsp =
                SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedSpecificIndexForIndexScan("COMPLEX", "COMPLEXIND"));
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TEMPLATE", "TEMPLATE_TWO"));
    }
   
    public void testBasic() throws SQLException {
        // basic test for update statistics; make sure that statistics with
        // correct values are created and dropped and such.
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"));

    //Drop statistics for T2I2 and we should see that we go back to using
    // T2I1 rather than T2I2
    s.execute("CALL SYSCS_UTIL.SYSCS_DROP_STATISTICS('APP','T2','T2I2')");
        stats.assertIndexStats("T2I2", 0);
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.