1 Reply Latest reply on Dec 8, 2010 3:28 PM by Steven Hawkins

    Generic question on push down approach.

    Barani Bikshandi Newbie



      I just want to know more about the push down approach of Teiid..


      For Ex:


      I have 2 sources. Source A and Source B and both the sources have very larget data (millions of records). One source is DB2 and another is Oracle and schemas of both the sources are totally different.


      I have created a common model in Teiid and mapped the source A and source B to my common model.


      I have a field called source name in my common model which has a hard coded value (I have mapped this hardcoded value when transforming the source model to common model) correponding to each source (EX: Source A and Source B). I am using this field to filter the data pertaining to particular source.


      When I issue a query on my common model..something like


      select * from commonmodel where sourcename='Source A'


      Will Teiid push down the query to source A or will it fetch entire data corresponding to all connector bindings attached to the common model then assign the hardcoded value based on the transformation query and then filter it based on the source.


      Since sourcename field is not in the source, I am not sure whether Teiid will push down the query or not.


      If not, can someone please let me know the best possible way to push down a query when we have heterogenous sources (with different schemas). Also we wont be able to add any field to source in order to force a push down based on that field.





        • 1. Re: Generic question on push down approach.
          Steven Hawkins Master

          In the scenario that you describe Teiid should query only one side.  You can confirm this by viewing the query plan.  If you just interested in seeing plan, be sure to call "SET NOEXEC ON" to disable execution.


          Teiid will always attempt to push conjunctive predicates as far as it can, which can be through views, unions, or joins.  Each time the predicate crosses a view layer or a view layer is removed from the query, the predicates are updated with the projected values.  So in your example there should be a point in planning where each union branch has a predicate with nothing but literals, like 'Source A'='Source A'.  At that point the optimizer will evaluate the predicate and adjust the plan accordingly.