Quantcast
Channel: SCN : All Content - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 757

optimize union in ase query

$
0
0

we have a "select" query using 3 union operators (4 selects in total). In ASE 12.5.4 ESD# 10 executes in 2 sec, in ASE 15.7 SP103 it needs 88sec. If I run only 2 "select" (one union) it runs fast

 

I enable "compatibility mode" but it has no effect at all. The main difference in the plans is that in 12.5 the query is parallelized, however even when I added "parallel clauses" the performance was not improved. None of the tables is partitioned, all the tables have clear dbcc, the tables are not very big (700000 rows max),sysmon seems ok.

 

The "statistics io" output shows considerable higher io for version 15.7 and this is probably the explanation. I have tested several options of the optimizer which do not work. Also I have increased the histogram steps which improved the performance up to 88sec (before this the query had not finished in 20min)

 

I tried to  use the abstract plan used in 12.5.4 but I have several messages like

 

Server 'TVSONL', Line 1:

The children of the 'nl_join ' operator don't have the required properties, as ordering, partitioning. The logical relational operation is valid at this point but it can not be implemented by this physical operator.

Server Message:  Number  1035, Severity  10

Server 'TVSONL', Line 1:

The AP property enforcer operators 'sort', 'xchg' or 'enforce' can be used to create the needed physical properties.

Server Message:  Number  1037, Severity  10

Server 'TVSONL', Line 1:

When an ordering is missing, the nl_join or h_join peer physical operators that don't need an ordering can be used.

Server Message:  Number  1027, Severity  10

Server 'TVSONL', Line 1:

 

I have no experience on abstract plans, but I shall try to read the manual and work on this.

 

I open this thread mostly for any ideas on what to do, I was surprised that compatibility mode has no effect and I really don't know what to do. Maybe there is a hint somewhere on optimizing "unions"

 

Thank you in advance


Viewing all articles
Browse latest Browse all 757

Trending Articles



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