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 > db2 access paths different with different tools

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-10, 09:04
ltaylor ltaylor is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
db2 access paths different with different tools

Does anyone have any ideas as to why the same sql statement would take different paths depending on the tool? (DB2 ZOS v9 Conversion mode)

Example, we have a query, we can run it in SPUFI, DB2 Connect, Toad, Foxy SQL, DB2 Data Studio, and with all of these it uses one access path which happens to be the most Efficient.

If we run that same query within the application, Java with Websphere, it chooses a different path.

Any thoughts?
Reply With Quote
  #2 (permalink)  
Old 12-01-10, 10:32
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
Muhahahaha! Websfear ...

DB2 Data Studio uses Java aswell. Dont know the others.
If the Application in Websphere uses a Prepared Statement (select tabschema, tabname from syscat.tables where tbspace=?), then this statement might be cached and using an older Access plan.
Reply With Quote
  #3 (permalink)  
Old 12-01-10, 13:14
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Websphere Application Server has a lot of options (properties) that can effect blocking, isolation level, etc, that could affect the access path of the statement. Some of the defaults used by WAS are different than what most other applications/tools would use.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 12-03-10, 12:04
ltaylor ltaylor is offline
Registered User
 
Join Date: Mar 2004
Posts: 4
settings

Any settings that you know of that would influence a different access path, and also cause it to fetch 27 times versus one fetch. The query we are using does do fetch first 26 rows, but it seems to be doing them one at a time when you go thru websphere. All other tools, get it using one fetch. (same query).
Reply With Quote
  #5 (permalink)  
Old 12-03-10, 13:05
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Check to see if the WAS application uses blocking or not blocking cursor (that should show up in the explain plan). Java programmers often use statements with unnecessary parameters that may prevent blocking (e.g. scrollable or updatable cursors).
Reply With Quote
  #6 (permalink)  
Old 12-03-10, 16:06
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Quote:
Originally Posted by ltaylor View Post
Any settings that you know of that would influence a different access path, and also cause it to fetch 27 times versus one fetch. The query we are using does do fetch first 26 rows, but it seems to be doing them one at a time when you go thru websphere. All other tools, get it using one fetch. (same query).
As I mentioned above, WAS has properties that will affect blocking, and hence number of rows fetched at one time from the server to the client. I don't know what they are, but I know they exist in WAS.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
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