Archives of the TeradataForum
Message Posted: Sat, 05 Apr 2008 @ 12:53:33 GMT
Victor Sokovin wrote:
I've seen that, too, but didn't know that it worked in earlier releases. In some patch levels of 6.2 a single-row view with a hard-coded date like Lubomir's was resolved by the optimizer without any cross-join. In 6.1 and newer patches of 6.2 it switched to a cross join without partition elimination.
In all patch levels of TD12 it's resolving it again, but only if the view is not nested:
replace view bla as select '2008-04-05' as today; replace view as select today + 1 as tomorrow, ... from bla;
doesn't work, just
replace view bla as select '2008-04-05' as today, today + 1 as tomorrow, ...;
In TD12 all the problems with calculations using current_date are solved, too, it's always like a date literal.
Which will result in a cross-join, too. But probably "enhanced by dynamic partition elimination".
That's the only case where you don't rely on the optimizer.
Maybe it's a TD12 feature only, which was ported back accidentally :-)
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|