Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 25 Sep 2006 @ 13:00:22 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Advise on creating views
From:   Heard, Duncan

Presumably you will have only a single table referenced in each of these views, with relatively simple where clauses in each. If you are doing joins in the views which are unioned you will end up with VERY complicated explain plans whenever you join any other tables to this unioned view. Sure it will work, but just don't expect the best plans out of the optimiser... I have seen BAD performance problems caused by this sort of thing with 100s of optimiser steps - get rid of the unions and you get 10's of steps...

You appear to be introducing significant complexity for no real benefit. How about rolling all your views into a single select statement, with case constructs handling the classification logic - at least that way you will only have to do one pass of the base table, versus 6 or so as your example suggests. For your example you would end up with 6 case constructs in your select.



  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023