Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Re: optimize union in ase query

$
0
0

I agree that you do not want to make too many changes but I guess breaking into simpler pieces will let you know what is the root cause. I would do following

select <query1> into #tab1

selcect query2 into #tab2

 

finall select * from #tab1 union select * from #tab2...

 

I will note down which statement is taking time and concentate only on that.

 

On a similar note, do you have any separate tempdb cache or do yu have any cache binding for tempdb and if yes what is the size of that cache. I have seen a very strange things that there are physical IO's for work tables and that will happen when you do not have enough space in cache for tempdb.

 

Also, is there any other load running on server at the time you run your query.

 

3rd and 4th query are using extra table SecSelBuyBck  and secdeal.Also query 3 and 4 has equal clause  on these new tables.

 

And F.TableName = 'S' --F is Secdeal

And B.TableName = '5' --b is SecSelBuyBck

 

Did you try to update the statistics on the tablename column in these tables? Default estimated values might have forced the wrong plan.

 

Thanks


Viewing all articles
Browse latest Browse all 3587

Trending Articles



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