1 Reply Latest reply on Mar 28, 2017 9:32 AM by Steven Hawkins

    Is Option MAKEDEP inside of Union Supported Now?

    Mike Higgins Newbie

      In my testing of 9.1, it seems that MAKDEP hints are parsed in a query that is contained in a union, but not applied to the query.

      I see that [TEIID-2381] Expanded source hint support - JBoss Issue Tracker discusses the difficulty of applying hints to a branch of a union, but U was not sure if there have been any changes in this area.

       

      Hints applied to the outermost query are applied, but to each instance of the table in the union query.  My problem is that only one of the branches of the union needs a MAKEDEP, not all of them.  Other instances of the same table should be processed normally (hint-less).

       

      Although it would be difficult, I could make sure that each instance of the table that needs a MAKDEP gets a unique alias, and use 'option makedep' on that alias.  When changing the SQL by hand (it's machine generated) this seems to work.

       

      Or, is there a better way?  Or am I just doing something wrong, and the hint should apply to the branch now?

       

      Thanks,

      Mike Higgins

       

      PS - as you probably already know, UNION or UNION ALL does not change planning