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

Looking at size of the query 88 seconds seems small . Jokes apart. If you see your plan you will see that 6 tables are used in reformatting using store index. If you see that these 6 tables are actually 3 tables but for 3rd and 4th select in your query. Thus your first 2 query with union ran fine but as soon as you added 3rd it went for store index for 3 tables and that took time. Same happened for 4th select statement. You will need to look into why it has chosen store index for query 3 and query 4.

 

I guess you mentioned that individual query gets executed fast. I would suggest that you simply insert each query's output into temp table and then do a union on those 4 tables.

 

Hopefully, it will help. If time permits I will look into query 3 and 4 to check why the store index used there.

 

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>