title: How to force Teradata parser to understand the join
body: <p>I would like your help for the next issue. It is a real problem, but I will present you like an example.</p>
  
  <p>I have a view which is composed as below</p>
  
  <pre><code>viewa =
  sel * from
  (
  calendar_dim
  inner join
  (
  sel * from table_a
  inner join table_b
  union all
  sel * from table_c
  inner join table_D
  )
  on...
  )
  </code></pre>
  
  <p>All the tables, table_a table_b table_c table_d have the same pi and partition columns (the 1st partition level is at the date), stats are up to date.</p>
  
  <p>My question is the following:</p>
  
  <p>If I will try to do a query such as</p>
  
  <pre><code>sel *
    from viewa
   where cal_Date = '2013-05-31'
  --&gt;&gt; the explain plan works perfect. It takes only one partition from each table and produce the result.
  </code></pre>
  
  <p>The same happens with multiple date , /......where cal_Date in ('2013-05-31','','',.......)
  (it takes the correct number of partitions ).</p>
  
  <p>But, if I try to inner join this view with a table, which contains 10 distinct dates, I was waiting to have 10 partitions from each table of the view  inner join this spool with the external table.</p>
  
  <pre><code>sel a.*
  from viewa a
    inner join table_e b
     on a.cal_Date = b.cal_Date
  </code></pre>
  
  <p>it does an all amp retrieve from each table of the view and then duplicates the external table. The issue is that the 4 tables inside the view are very big, about 1 billion rows.</p>
  
  <p>Solution for this?</p>
  
  <p>I tried to make a volatile table (with one column =  date) which contains only the distinct date that I am expected but nothing. Still the same behaviour.</p>