Package org.apache.derbyTesting.junit

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


                "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
        // best statistics (the weight stuff in predicatelist)
View Full Code Here


                "and t1.twenty = t2.twenty " +
                "and t1.hundred = t2.hundred").close();
        checkEstimatedRowCount(conn,4010.00625);
        RuntimeStatisticsParser rtsp =
                SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        // now muck around with the order of the predicates
        // 2,100,20
        s.executeQuery("select t1.id from t1, t2 " +
                "where t1.two = t2.two " +
View Full Code Here

                "where t1.two = t2.two " +
                "and t1.hundred = t2.hundred " +
                "and t1.twenty = t2.twenty").close();
        checkEstimatedRowCount(conn,4010.00625);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        // 100,20,2
        s.executeQuery("select t1.id from t1, t2 " +
                "where t1.hundred = t2.hundred " +
                "and t1.twenty = t2.twenty " +
View Full Code Here

                "where t1.hundred = t2.hundred " +
                "and t1.twenty = t2.twenty " +
                "and t1.two = t2.two").close();
        checkEstimatedRowCount(conn,4010.00625);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        // 100,2,20
        s.executeQuery("select t1.id from t1, t2 " +
                "where t1.hundred = t2.hundred " +
                "and t1.two = t2.two " +
View Full Code Here

                "where t1.hundred = t2.hundred " +
                "and t1.two = t2.two " +
                "and t1.twenty = t2.twenty").close();
        checkEstimatedRowCount(conn,4010.00625);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        s.executeQuery("select t1.id from t1, t2 " +
                "where t1.twenty = t2.twenty " +
                "and t1.hundred = t2.hundred " +
                "and t1.two = t2.two").close();
View Full Code Here

                "where t1.twenty = t2.twenty " +
                "and t1.hundred = t2.hundred " +
                "and t1.two = t2.two").close();
        checkEstimatedRowCount(conn,4010.00625);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        s.executeQuery("select t1.id from t1, t2 " +
                "where t1.twenty = t2.twenty " +
                "and t1.two = t2.two " +
                "and t1.hundred = t2.hundred").close();
View Full Code Here

                "where t1.twenty = t2.twenty " +
                "and t1.two = t2.two " +
                "and t1.hundred = t2.hundred").close();
        checkEstimatedRowCount(conn,4010.00625);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
    }
   
    // Beetle was the bug system for Cloudscape, the forerunner
    // of Derby. The bug report described a query that was hitting an Error:
    // XJ001: Java exception: '2 >=2: java.lang.ArrayIndexOutOfBoundsException
View Full Code Here

                            "    (SELECT * FROM FLIGHTS, COUNTRIES) S " +
                            "  ON CITIES.AIRPORT = S.ORIG_AIRPORT " +
                            "  WHERE S.COUNTRY_ISO_CODE = 'US'");

        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());

        // 1. Equivalent variant failed to rewrite prior to patch and was slow.
        rs = s.executeQuery("SELECT * FROM CITIES LEFT OUTER JOIN FLIGHTS " +
                            "    INNER JOIN COUNTRIES ON 1=1 " +
                            "    ON CITIES.AIRPORT = FLIGHTS.ORIG_AIRPORT " +
View Full Code Here

        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);

        // Check that outer join has been rewritten
        assertFalse(rtsp.usedNLLeftOuterJoin());
        assertTrue(rtsp.usedHashJoin());


        // 1b. Equivalent variant of 1, just use ROJ instead.
        rs = s.executeQuery("SELECT * FROM FLIGHTS " +
                            "    INNER JOIN COUNTRIES ON 1=1 " +
View Full Code Here

        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);

        // Check that outer join has been rewritten
        assertFalse(rtsp.usedNLLeftOuterJoin()); // ROJ is made LOJ in case
                                                 // still used
        assertTrue(rtsp.usedHashJoin());


        // 2. Equivalent variant failed to rewrite prior to patch and was slow.
        rs = s.executeQuery("SELECT * FROM CITIES LEFT OUTER JOIN " +
                            "   (FLIGHTS CROSS JOIN COUNTRIES) " +
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.