Package org.apache.derbyTesting.junit

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


                            "  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


        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());

    }


    static void insertTourRow(PreparedStatement ps, String a, String b)
View Full Code Here

                { "4", "8", "4", "8" }, { "5", "10", "5", "10" } };

        JDBC.assertFullResultSet(rs, expRS, true);

        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected hash join", p.usedHashJoin());

        // When we
        // have very deeply nested union queries, make sure
        // predicate push- down logic still works (esp. the scoping
        // logic). These queries won't return any results, but the
View Full Code Here

        JDBC.assertFullResultSet(rs, expRS, true);
        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 hash join", p.usedHashJoin());
        }
        //  Outer
        // predicate should either get pushed to V2 (T3 and T4) or
        // else used for a hash join; similarly, inner predicate
        // should either get pushed to T3 or else used for hash
View Full Code Here

                { "4", "-8", "4", "4" }, { "4", "8", "4", "4" },
                { "4", "-8", "4", "16" }, { "4", "8", "4", "16" }};
       
        JDBC.assertFullResultSet(rs, expRS, true);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected hash join", p.usedHashJoin());

        // Inner predicates treated as restrictions, outer
        // predicate either pushed to X2 (T2 and T1) or used for
        // hash join between X2 and X1.
View Full Code Here

        JDBC.assertFullResultSet(rs, expRS, true);
        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 hash join", p.usedHashJoin());
        }
        // Following queries deal with nested subqueries, which
        // deserve extra testing because "best paths" for outer
        // queries might not agree with "best paths" for inner
View Full Code Here

        expColNames = new String[] { "I", "P" };
        JDBC.assertColumnNames(rs, expColNames);
        JDBC.assertDrainResults(rs, 0);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected hash join", p.usedHashJoin());
        assertTrue("Expected table scan on T1", p.usedTableScan("T1"));
        assertTrue("Expected index row to base row for T3", p.usedIndexRowToBaseRow("T3"));
       
        // Multiple, non-flattenable subqueries, but NO UNIONs.  Shouldn't push
        // anything.
View Full Code Here

        expColNames = new String[] { "A", "I" };
        JDBC.assertColumnNames(rs, expColNames);
        JDBC.assertDrainResults(rs, 0);
        p = SQLUtilities.getRuntimeStatisticsParser(st);
        assertTrue("Expected hash join", p.usedHashJoin());
        assertTrue("Expected index scan on T3", p.usedIndexScan("T3"));
        assertTrue("Expected index scan on T4", p.usedIndexScan("T4"));

        // Same as
        // above but without the inner predicate (so no hash on T6).
View Full Code Here

        expRS = new String[][] { { "1", "2", "2", "2" }, { "2", "4", "4", "4" } };

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

        rs = st.executeQuery("select * from V2, V1 where V1.j = V2.b");

        expColNames = new String[] { "A", "B", "I", "J" };
        JDBC.assertColumnNames(rs, expColNames);
View Full Code Here

        expRS = new String[][] { { "2", "2", "1", "2" }, { "4", "4", "2", "4" } };

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

        // Nested unions.

        rs = st
                .executeQuery("select * from (select * from t1 union select * from "
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.