|
|
Archives of the TeradataForum
Message Posted: Mon, 25 Sep 2006 @ 13:00:22 GMT
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.
Regards,
Duncan
| |