Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2569

Inefficient Outer Join compensation when translator restricted on KEY based joins

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 8.5
    • None
    • Query Engine
    • None

    Description

      When the following capabilities are set on ExecutionFactory

      setSupportsOuterJoins(true);
      setSupportedJoinCriteria(SupportedJoinCriteria.KEY);
      

      A three table JOIN like

      select G1.e1, G2.e1, G3.e1 from G1, G2, G3 where G1.e1=G2.e2 and G2.e2 = G3.e3
      

      gets pushed to translator as two separate queries like

      SELECT G3.e3 AS c_0, G3.e1 AS c_1 FROM G3 ORDER BY c_0
      SELECT G2.e2 AS c_0, G1.e1 AS c_1, G2.e1 AS c_2 FROM G1 LEFT OUTER JOIN G2 ON G1.e1 = G2.e2 WHERE G2.e2 IS NOT NULL ORDER BY c_0
      

      instead of of one query which should be like

      SELECT G1.e1, G2.e1, G3.e1 FROM G1 INNER JOIN G2 ON G1.e1 = G2.e2 INNER JOIN G3 ON G2.e2 = G3.e3
      

      When the key restriction is removed, it works fine, which should be un-related.

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            rhn-engineering-rareddy Ramesh Reddy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: