Quantcast
Channel: SCN: Message List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 9165

Re: faster alternative to where clause in SQL

$
0
0

That was the idea given by a consultant from SAP , that placeholders/input param push the filters deep into the data base unlike where clause .

 

My objective is to left outer join two massive fact tables (400 + million records each).

 

So I been looping over time period to break up into sizable chunks. 

 

create procedure sp

as

xyear := 2010;

begin

 

 

while year <= 2020

var_a = select dim1, dim2, mea1 , mea2 from _sys_bic.AN_FACT1  where year = : xyear group by dim1, dim2 ;

var_b = select dim3, dim4, mea3, mea4 from _sys_bic.AN_FACT group by dim3, dim4;

 

var_join = select dim1,dim3 , mea1, mea2, mea3, mea4 from var_a left join var_b on dim2=dim3 ... ;

 

insert  into ACTUAL_TABLE (select * from var_join);

xyear = : xyear +1;

end while;

end;

 

 

What optimizations can i bring to this ( other than using CE_SCRIPTS)

 

and

I am writing to a actual table , how can i store the looped result sets into a table_type .

 

Rishi


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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