Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Query from view optimizations - response (1) by dnoeth

$
0
0
The optmizer might do a join elimination when it's not changing the result set. There are two issues with your approach: #1: It must be a join to a UNIQUE/PK column. In your case this is not known by the optmizer (indicated by the increasing estimated number of rows in each step). #2: There must be an Outer Join or a Foreign Key. Your view results in an Inner Join due to the WHERE condition on a1.PART and a2.PART.   To fix it you should define (PART, KEY) as UNIQUE and move a1.PART='01' and a2.PART='02' into the ON condition. Dieter  

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>