[
https://issues.jboss.org/browse/TEIID-1376?page=com.atlassian.jira.plugin...
]
Steven Hawkins resolved TEIID-1376.
-----------------------------------
Resolution: Done
Added RuleDecomposeJoin to handle this situation. The decision to decompose is based upon
detecting that each side of the join is a partitioned union (note that non-ansi joins of
more than 2 tables may cause the optimization to not detect the appropriate join). Union
partitioning is inferred from the transformation/inline view. If one (or more) of the
union columns is defined by constants and/or has IN predicates in the WHERE clause that
make each branch mutually exclusive, then the union is considered partitioned. e.g.
"select 1 as x, y from foo union all select z, a from foo1 where z in (2, 3)"
would be considered partitioned on x. Note that more advanced or explicit partition could
be considered in the future.
The rule currently only looks for situations where at most 1 partition matches from each
side. This is a simplifying assumption based upon the lack of arbitrary sub-plan cloning
and potentially making the decision costing dependent.
The release notes have been updated, but the docs still need to add the concept of a
partitioned union. The concept of partitioning will also be used so that views with
unions can be inherently insertable.
Add support for pushing joins through a union
---------------------------------------------
Key: TEIID-1376
URL:
https://issues.jboss.org/browse/TEIID-1376
Project: Teiid
Issue Type: Feature Request
Components: Query Engine
Affects Versions: 7.2
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 7.3
Given a query structure such as:
inner join
union all
a
b
union all
c
d
where a,b,c,d are access nodes to a source that supports joins and there is a constant
column projected by each union branch and that column is used in the join predicates, then
we should be able examine
union all
inner join
a
b
inner join
a
c
...
to determine if any of the joins will no longer be necessary.
This is a possible pattern in a multi-source or partitioning scenario.
In some scenarios there may not be an actual projected literal, which could be
accommodated if a foreign key could be marked as partitioned.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira