cancel
Showing results for 
Search instead for 
Did you mean: 

The Performance of SQL Script in HANA Calculation View.

former_member435389
Participant
0 Kudos

Hi experts,

SQL Script using in HANA Calculation View :

[1].

BEGIN

TAB_A = select * from A;

select * from B inner join :TAB_A ;

END

[2].

BEGIN

select * from B inner join (select * from A) ;

END

Questions :

1. Which will cost less time ? Or the same time ?

2. In case [1], will "select * from A" run twice ? One time for TAB_A, another time for "inner join :TAB_A" ?

Tks.

View Entire Topic
Cocquerel
Active Contributor

the SQLScript compiler will, by default, try to combine statements in one. See https://help.sap.com/docs/SAP_HANA_PLATFORM/de2486ee947e43e684d39702027f8a94/23531168b23340c08731b96...

So, you should get the same performance for both.

Regards,

Michael

former_member435389
Participant
0 Kudos

Hi, Michael

I made a test for both cases , it seems case [1] cost less time.

Is there any mistake in my test ?

[1].

[2].

Tks.

Cocquerel
Active Contributor
0 Kudos

you can run script similar to the following one to see the combined statement for case [1]

do ( )
Begin
TAB_A = select * from A;
select * from B inner join :TAB_A ;
select * from M_ACTIVE_PROCEDURES
where procedure_connection_id = current_connection;
end;
former_member435389
Participant
0 Kudos

The result of M_ACTIVE_PROCEDURES seems the same again.