Examples of usedHashJoin()


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

                "test, template --DERBY-PROPERTIES joinStrategy=hash, " +
                "index=null \n" +
                "where test.hundred = template.hundred and test.id <= 100").close();
        checkEstimatedRowCount(conn,3924.9);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
        assertTrue(rtsp.usedSpecificIndexForIndexScan("TEST", "TEST_ID"));
    }
   
    public void testMultiPredicate() throws SQLException {
        // multi predicate tests.
View Full Code Here

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

                "where test.twenty = template.twenty " +
                "and test.two = template.two").close();
        checkEstimatedRowCount(conn,401000.625);
        RuntimeStatisticsParser rtsp =
                SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        // join on twenty/two. template inner, NL, index=template_two, all rows
        s.executeQuery("select template.id from " +
                "--DERBY-PROPERTIES joinOrder=fixed \n" +
                "test, template --DERBY-PROPERTIES joinStrategy=nestedLoop, " +
View Full Code Here

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

                "index=null \n" +
                "where test.twenty = template.twenty " +
                "and test.two = template.two").close();
        checkEstimatedRowCount(conn,401000.625);
        rtsp = SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        // join on twenty/two. index twenty_two dropped.
        // template inner, NL, index=template_two, all rows.'
        s.executeQuery("select template.id from " +
                "--DERBY-PROPERTIES joinOrder=fixed \n" +
View Full Code Here

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

                            "    (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

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

        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

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

        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

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

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

        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

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

                "where t1.two = s.two " +
                "and s.hundred = CAST(CHAR(t1.hundred) AS INTEGER)").close();
        checkEstimatedRowCount(conn,802001.25);
        RuntimeStatisticsParser rtsp =
                SQLUtilities.getRuntimeStatisticsParser(s);
        assertTrue(rtsp.usedHashJoin());
       
        // preds are on column 2.
        // 0.1 -> 16*10.5
        s.executeQuery("select s.id from " +
                "--DERBY-PROPERTIES joinOrder=fixed \n" +
View Full Code Here

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

                "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 " +
                "--DERBY-PROPERTIES joinOrder=fixed \n" +
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.