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 > SQL with the same execution plan

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-12-11, 10:15
shubin_du shubin_du is offline
Registered User
 
Join Date: Feb 2009
Location: Germany
Posts: 23
SQL with the same execution plan

Hello,

How can I find in DB2 LUW 9.5 which SQLs have the same execution plan? I doesn't found admin view (in sysibmadm) that contains unique identity of the sql in cache (hash, id or other identity) and execution plan identity. Is it possible to find identity for the sql and plan and then select in some admin views sqls by plan identity. I can give a simple example:

SLQ with ID=200 has plan with ID=20
SLQ with ID=323 has plan with ID=67
SLQ with ID=400 has plan with ID=20

I know that my "bad" SQL has identity 200 and plan with identity 20. I would like to find other SQLs that have the plan with identity 20. In this example it is SQL wth identity 400.

Is it possible?

In Oracle I use V$SQL and V$SQL_PLAN. In DB2 I use now sysibmadm.snapdyn_sql but it has no sql indentity.

Thanks,
Sergey
Reply With Quote
  #2 (permalink)  
Old 07-12-11, 10:57
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I'm not sure what you're after, but try "db2pd -dynamic" - look for statement anchor ID (AnchID).
Reply With Quote
  #3 (permalink)  
Old 07-12-11, 12:09
shubin_du shubin_du is offline
Registered User
 
Join Date: Feb 2009
Location: Germany
Posts: 23
Quote:
Originally Posted by n_i View Post
I'm not sure what you're after, but try "db2pd -dynamic" - look for statement anchor ID (AnchID).
Thank you,

I have found SQL identity in db2pd report but I can't find the plans.

Is there any admin view that produces the same output as db2pd? The problem is - the view can be selected and the db2pd report is only the plain text.
Reply With Quote
  #4 (permalink)  
Old 07-12-11, 12:29
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by shubin_du View Post

Is there any admin view that produces the same output as db2pd?
Not that I know of.
Reply With Quote
  #5 (permalink)  
Old 07-12-11, 12:39
shubin_du shubin_du is offline
Registered User
 
Join Date: Feb 2009
Location: Germany
Posts: 23
thank you n_i. the absence of information is information as well.
Reply With Quote
  #6 (permalink)  
Old 07-12-11, 17:36
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
Check statement and plan "hash value"

Probably not exactly what you're looking... and not available in v9.5.
Reply With Quote
  #7 (permalink)  
Old 07-13-11, 05:46
shubin_du shubin_du is offline
Registered User
 
Join Date: Feb 2009
Location: Germany
Posts: 23
Quote:
Originally Posted by BELLO4KA View Post
Check statement and plan "hash value"

Probably not exactly what you're looking... and not available in v9.5.
thank you белочка. there was the same question i have made in my post )) it is interesting that 9.7 has the unique id for sql. i try to find the solution in 9.7 although we use now 9.5.
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