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

Re: Slow case statement evaluation comparing values from two tables

$
0
0

Hi guys,

 

After reading your suggestion we tried coalesce however we did not see any improvement whatsoever.  Also thanks for the tips Lars.  What we did find was that if we used input parameters the performance was greatly improved.  Strangely the original case statement OR the coalesce both performed well when we restarted our server (we have seen strange issues with 68 like this) but only when running the entire raw SQL script inside SQL editor.  ie: if our calculation view contains 100 lines of code and we paste it into SQL editor it works great.  Alternatively if we reference the view directly like this;

 

select * from "SYS_BIC"."CalcViewName" where condition = 'abc'

 

This performance is bad.  If we parameterize the calculation view and change the way we reference the view like this it is now flying;

 

select * from "SYS_BIC"."CalcViewName"

('PLACEHOLDER' = ('$$CONDITION$$', ''abc'''))


This makes sense to me as it seems to be pushing the filter to the beginning of the query.  What does not make sense to us is why running the entire SQL directly in SQL editor (without parameters) works very fast as well.  It's only when calling the view directly via SYS_BIC that it becomes slow and then requires the input parameters.  You might then ask why we care, just put the input parameters in the view and call it done!  Well the issue is with Microstrategy tool that we are using which has limitation around multiple values in a single parameter.


-Patrick


Viewing all articles
Browse latest Browse all 9165

Trending Articles



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