Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Why a Calculation View path is calculated also when useless?

$
0
0

Hi all,

 

I have a quite complex calculation view that is split into two main branches by a Union.

 

In my query I use a measure that is populated by only one of the two branches that  are input of the Union, but looking at the Visual plan I see that also the second branch is calculated and moreover the where conditions of my queries are not applied when calculating this second branch, so leading to a big performance degradation.

 

In the following pictures you can see the Calculation view with the Union details, the query that I run and part of the Visual Plan.

 

As you can see I query the "IMPORTO" field that is present in only one of the Union inputs, but looking at the Visual Plan I see that also the other branch is calculated and a lot of rows are returned (and then exclueded in the final step), while for the specified WHERE clause, only 4 rows are present in the database, that is aggregated to just one row in the final result.

 

 

Capture.JPG

select

COD_CONTO,COD_SCENARIO,importo

from

"_SYS_BIC"."tgkanalytics/TAGETIK03TESTC"

WHERE

COD_CONTO='50010'

and COD_SCENARIO='2012ACT'

and COD_PERIODO='12'

and name_azienda='A00 - Distribution Rome'

and DESC_PERIOD_LENGTH1='Cumulated'

and name_dest2 = 'A12 - Games'

 

Capture.JPG

 

So I have two questions in conclusion.

The first one is, why the second branch of thet Union inputs is calculated, also if it does not contain one of the field ('importo') of the SELECT?

The secon one is, why in the second branch the WHERE conditions seem to not be propagated?

 

Thanks for any answer or consideration.


Viewing all articles
Browse latest Browse all 6412

Trending Articles



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