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

Incorrect rewrite of subquery

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.4.1, 7.5
    • 7.4
    • Query Engine
    • None
    • Hide

      Do not use the explicit MJ hint, or if org.teiid.subqueryUnnestDefault is set to true, then ensure that the subquery returns distinct values.

      Show
      Do not use the explicit MJ hint, or if org.teiid.subqueryUnnestDefault is set to true, then ensure that the subquery returns distinct values.

      when performing a semi-join against a query with a key preserved in the semi join criteria and a non-distinct subquery the planner will incorrectly created an unnested query that does not preserve the semi-join. This can happen with either the explicit mj hint or with the query unnesting property set.

      e.g.

      select col2 from tbl where keyCol IN (select dupCol from tbl2)

      will become

      select col2 from tbl, tbl2 where keyCol = tbl2

      rather than

      select col2 from tbl, (select distinct dupCol from tbl2) x where keyCol = tbl2

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

              Created:
              Updated:
              Resolved: