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

Hi,

 

You should persist down the missing_stats route, it may well help to create a few histograms.

Are you absolutely sure that compatibility mode (maybe at server level) was not on?

The fact it is not only priming the search engine with the legacy AP, but actually using it in full usually would mean that basic_optimization was set (which isn't the case here) or it is using partial compatibilty mode ( same thing as basic).

If it is on then any changes to the 15x Optimizer criteria will have no effect unless specified in an abstract plan themselves.

The 'show long' will contain all that is in a 'show on' output but will also contain the logical properties stage ( which is actually where ASE forms the basis of the row counts you see in the plancost output), the codegen phase (no use to anyone unless you are trying to debug something more than plan choice), some extra pushdown info, more info in eqc competition (can be key), more info post 'best plan' stage - and gumpf. It is a requirement to really try to piece together what is going on in a lot of circumstances however with more than 4 or 5 tables and anything other than a few simple entries in the predicate, as is likely here, it becomes unmanageable.

 

Disable all parallel and make sure you have no forces in the query (no parallel hints etc), then

 

 

 

Run this:-

 

set compatibilty_mode off

set statement_cache off

set plan optlevel ase_current

set option show on

set option show_log_props on

set statistics time,io,plancost,resource on

set option show_missing_stats on

set showplan on

set show_sqltext on

dbcc traceon (526, 3604)

go

<query>

 

Then do the same again i.e. (all the commands )but add in:

 

set store_index off

 

Then the same as the first set again adding in:

 

set alternative_greedy_search off

 

Then the same as the first set again with:

 

set store_index off

set alternative_greedy_search off

 

Then the same as the first set again but add in:

 

set plan optlevel ase_default

 

And post the outputs. As Jeff said, ddl is really needed to help out here and maybe optdiag outputs as well. Can you run it on 125x with showplan and set statistics time, io on as well?

 

Be prepared that modifying/splitting out this query might be your only option.

 

Cheers,

 

Simon


Viewing all articles
Browse latest Browse all 3587

Trending Articles