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

Re: n-ary nested join vs merge join

$
0
0

The ASE 15.x optimizer a) is quite finicky when it comes to statistics (have you run 'update index stats' on all referenced tables?) and b) tends to ignore/underscore the cost of worktables when costing merge joins (ie, merge joins look cheaper than they really are).  In your case it's hard to tell at this point without seeing the query plan and reviewing the stats on the various tables.

 

ASE 15's default (ie, out of the box) optimization goal is allrows_mix, which enables the use of merge joins.  When I have a choice I prefer to reconfigure the dataserver to use allrows_oltp (only uses nested loop joins) (see 'sp_configure optimization') ... this tends to bring ASE 15's optimizer more in line with what we've been used to under ASE 12.5.x.  Then for the occasional query where a merge (or hash) join would be of benefit I will use the session-/query-level settings to invoke the allrows_mix (allrows_dss) optimization goal.

 

So, I'd suggest running 'update index stats' on all tables and re-run your queries to see if this  eliminates the merge joins.  If you still see merge joins you could try setting the optimization goal to allrows_oltp (at the dataserver-/session-/query-level) to disable merge joins.


Viewing all articles
Browse latest Browse all 3678

Trending Articles



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