If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL0437W Reason Code 1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-31-10, 20:13
meehange meehange is offline
Registered User
 
Join Date: Jul 2004
Posts: 256
SQL0437W Reason Code 1

9.2 fp4a AIX
OK So I have some ludicrously long, complex and unsurprisingly poorly performing reporting SQLs I'm trying to (unsuccessfully) tune and I'm getting the old SQL0437W Performance of this complex query may be sub-optimal. Reason code: "1".

I've increased the STMTHEAP to a whopping 163920*4k pages and reduced the Query Opt to 2.

One of the statements is 1000 lines long with lots of CASE and sub-SELECTS etc. but I would have thought a 60MB Statement Heap should cover it, or am I mistaken?

Any ideas?
Reply With Quote
  #2 (permalink)  
Old 01-31-10, 20:48
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Seems that not only 1000 lines (wow), but also multiple joins in the query.

Without having looked at the query, I may suggest to try split it in some small queries, try to reduce joins if possible
Reply With Quote
  #3 (permalink)  
Old 01-31-10, 21:29
meehange meehange is offline
Registered User
 
Join Date: Jul 2004
Posts: 256
Quote:
Originally Posted by DBFinder View Post
Seems that not only 1000 lines (wow), but also multiple joins in the query.

Without having looked at the query, I may suggest to try split it in some small queries, try to reduce joins if possible
Yea I usually make the "Can you please write better SQL" request but often it's either Application generated code or they simply say they can't do any better... You should seen the EXPLAIN on this sucker.... db2advisor recommended 30 indexes yieling only a 17% projected improvement. Gonna look at MDC and stuff now I think, see if I can get any boost there.

FML :P
Reply With Quote
  #4 (permalink)  
Old 02-04-10, 23:04
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Did you try REORG/Runstats on the table. See if it helps.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On