Package org.apache.derbyTesting.junit

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


                { "4", "8", "4", "4" }, { "4", "8", "4", "16" } };

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected table scan", p.usedTableScan());
        assertTrue("Expected hash join", p.usedHashJoin());


        rs = st
                .executeQuery("select * from (select * from t1 union all select * "
                        + "from t2) x1, (select * from t3 union select * from "
View Full Code Here


                { "4", "-8", "4", "16" } };

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected table scan", p.usedTableScan());
        assertTrue("Expected hash join", p.usedHashJoin());

        rs = st
                .executeQuery("select * from (select * from t1 union select * from "
                        + "t2) x1, (select * from t3 union all select * from "
                        + "t4) x2 where x1.i = x2.a");
View Full Code Here

                { "4", "8", "4", "4" }, { "4", "8", "4", "16" } };

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected table scan", p.usedTableScan());
        assertTrue("Expected hash join", p.usedHashJoin());


        rs = st
                .executeQuery("select * from (select * from t1 union all select * "
                        + "from t2) x1, (select * from t3 union all select * "
 
View Full Code Here

                { "4", "-8", "4", "16" } };

        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected table scan", p.usedTableScan());
        assertTrue("Expected hash join", p.usedHashJoin());

        // Next set of queries tests pushdown of predicates whose
        // column references do not reference base tables--ex. they
        // reference literals, aggregates, or subqueries. We don't
        // check the query plans here, we're just checking to make
View Full Code Here

        p = SQLUtilities.getRuntimeStatisticsParser(st);
        // DERBY-3819 - this test case consistently fails for 64 bit
        // temporarily (until 3819 is fixed by changing the queries with optimizer directives)
        if (!is64BitJVM()) {
            assertTrue("Expected Table Scan ResultSet for T3", p.usedTableScan("T3"));
            assertTrue("Expected Hash Join",p.usedHashJoin());
        }

        // If we
        // have nested unions, the predicate should get pushed all
        // the way down to the base table(s) for every level of
View Full Code Here

                { "5", "10", "5", "10" } };

        JDBC.assertFullResultSet(rs, expRS, true);

        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected Hash Join", p.usedHashJoin());
        // Can't
        // push predicates into VALUES clause. We'll try to push
        // it to X1, but it will only make it to T4; it won't make
        // it to T3 because the "other side" of the union with T3
        // is a VALUES clause. So we'll see an index scan on T4
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

                            "  WHERE COUNTRIES.COUNTRY_ISO_CODE = 'US'");
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);

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

        // 2b. Equivalent variant of 2, just use ROJ instead.
        rs = s.executeQuery(
            "SELECT * FROM " +
            "   (FLIGHTS CROSS JOIN COUNTRIES) RIGHT OUTER JOIN " +
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.