4 Replies Latest reply on Nov 12, 2015 10:35 AM by shawkins

    Hi All, how do I do a hash join in JBOSS DV?

    allenyu6

      need to do a hash join for the two tables. How do I do it, does not seem to be able to write a query like

       

      select * From A hash Join B when I edit in the sql panel.

        • 1. Re: Hi All, how do I do a hash join in JBOSS DV?
          shawkins

          There is no hash join in Teiid.  Are you trying to push down a hint or have Teiid evaluate a hash join?  In the latter case Teiid typically relies on costing to determine the join strategy which can include performing an enhanced sort merge join which can optionally sort the smaller relation and use it as a lookup index for the other side.

          • 2. Re: Hi All, how do I do a hash join in JBOSS DV?
            allenyu6

            thanks, but if I have two unparellel tables with one side much smaller than the other, the JBOSS DV seems choked on it, how do I do I hint (or a pseudo hash join)?

            • 3. Re: Hi All, how do I do a hash join in JBOSS DV?
              shawkins

              Define choke, and what are you seeing as the query plan, and have you set at least the cardinalities on the relevant tables?

              • 4. Re: Hi All, how do I do a hash join in JBOSS DV?
                shawkins

                To expand on the last comment. When tables being joined from different sources are unbalanced, then most of the time you would want what is called a dependent join to be performed.  This will filter the larger side against the equi join values from the other side rather than pulling all of the rows.  However we will only plan a dependent join based upon costing information or a hint.  That is why the table cardinalities are important.  Beyond that if there is still an imbalance that is where the enhanced sort merge join comes into play.