Predicate pushing in Teradata

Database

Predicate pushing in Teradata

Hi,

I have created a View referencing the base tables in TD and this View is in
turn called by a Macro.The Macro defination is someting like this :
------------------------------------------------------------------------------
CREATE MACRO MAC.PRC_TEST
(Location INTEGER)
AS (
SELECT *
FROM VW.PRC_TEST_VIEW
WHERE LOC = :Location; );
------------------------------------------------------------------------------

Now the issue is that i don't want column LOC in the SELECT clause of my View defination (which is necessary for this Macro to work ). Is there someway i can direct the optimizer to perform predicate pushing wherein the condition
LOC = :Location is pushed into the View's defination (SQL Extension) so that even if column LOC is not in SELECT clause of View, this MACRO will execute??

Thanks in advance...

Satish
3 REPLIES
Enthusiast

Re: Predicate pushing in Teradata

No, the column has to be in the view in order for you to use it in the WHERE clause in your macro.

What is the reason that you don't want it in the view?

Re: Predicate pushing in Teradata

I don't want this column in the View defination query because i want data to be grouped at a certain level (it has summaries) which doesn't include the column i am talking about...

-- Satish
Enthusiast

Re: Predicate pushing in Teradata

Can't you do the grouping that you want in the macro itself?