473,378 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

capturing optimization level used for certain sql

hello,

where can i see what optimization level a certain sql has used ?
is there any snapshot, event monitor, query patroller information
which can be used to see that ?

regards,
db2admin
Oct 30 '08 #1
7 2425
you can use
db2pd -db DBNAME -dynamic -full

In the section "Dynamic SQL Environments:" is the second last col the
optimization level.

Use anchorID and StmtUID to join the informations of the (three)
sections.
On Oct 30, 3:42*pm, db2admin <jag...@gmail.comwrote:
hello,

where can i see what optimization level a certain sql has used ?
is there any snapshot, event monitor, query patroller information
which can be used to see that ?

regards,
db2admin
Oct 31 '08 #2
On Oct 31, 10:11*am, "stefan.albert" <stefan.alb...@spb.dewrote:
you can use
db2pd -db DBNAME -dynamic -full

In the section "Dynamic SQL Environments:" is the second last col the
optimization level.

Use anchorID and StmtUID to join the informations of the (three)
sections.

On Oct 30, 3:42*pm, db2admin <jag...@gmail.comwrote:
hello,
where can i see what optimization level a certain sql has used ?
is there any snapshot, event monitor, query patroller information
which can be used to see that ?
regards,
db2admin
thankyou
i am wondering if all sqls get recorded in the output of this db2pd
command. i asked my developer to run some application which use some
SQLs using JDBC and after i ran this db2pd command. i was not able to
see any of the SQL used by the application my developer ran.
am i missing something ?
Oct 31 '08 #3
db2pd is an evolved snapshot command. It gives you what is there at
that time.
If the statement is gone and executed db2pd may not report on it if
it is not in the cache anymore.

If you need to catch only some statements you can read into the DB2
Info. Center about event monitors.
You can set one for stements and apply either applid or userid for
filtering. Once the event monitor is started it will catch what you
want and you can then analyze the output for your info.

Regards, Pierre.
On Oct 31, 2:00*pm, db2admin <jag...@gmail.comwrote:
On Oct 31, 10:11*am, "stefan.albert" <stefan.alb...@spb.dewrote:
you can use
db2pd -db DBNAME -dynamic -full
In the section "Dynamic SQL Environments:" is the second last col the
optimization level.
Use anchorID and StmtUID to join the informations of the (three)
sections.
On Oct 30, 3:42*pm, db2admin <jag...@gmail.comwrote:
hello,
where can i see what optimization level a certain sql has used ?
is there any snapshot, event monitor, query patroller information
which can be used to see that ?
regards,
db2admin

thankyou
i am wondering if all sqls get recorded in the output of this db2pd
command. i asked my developer to run some application which use some
SQLs using JDBC and after i ran this db2pd command. i was not able to
see any of the SQL used by the application my developer ran.
am i missing something ?
Nov 2 '08 #4
On Nov 2, 5:51*pm, Pierre StJ <p.stjacq...@videotron.cawrote:
db2pd is an evolved snapshot command. It gives you what is there at
that time.
If the statement is gone and executed db2pd may not report on it *if
it is not in the cache anymore.

If you need to catch only some statements you can read into the DB2
Info. Center about event monitors.
You can set one for stements and apply either applid or userid for
filtering. Once the event monitor is started it will catch what you
want and you can then analyze the output for your info.

Regards, Pierre.
On Oct 31, 2:00*pm, db2admin <jag...@gmail.comwrote:
On Oct 31, 10:11*am, "stefan.albert" <stefan.alb...@spb.dewrote:
you can use
db2pd -db DBNAME -dynamic -full
In the section "Dynamic SQL Environments:" is the second last col the
optimization level.
Use anchorID and StmtUID to join the informations of the (three)
sections.
On Oct 30, 3:42*pm, db2admin <jag...@gmail.comwrote:
hello,
where can i see what optimization level a certain sql has used ?
is there any snapshot, event monitor, query patroller information
which can be used to see that ?
regards,
db2admin
thankyou
i am wondering if all sqls get recorded in the output of this db2pd
command. i asked my developer to run some application which use some
SQLs using JDBC and after i ran this db2pd command. i was not able to
see any of the SQL used by the application my developer ran.
am i missing something ?
thankyou Pierre,

I thought about even monitor on statement but did not try yet because
i was in doubt if this will capture optimization level information
I guess i will try and find out
Nov 4 '08 #5
This information is not in the data captured with event monitor for
statement.
Also the snapshot does not give this information.
db2pd seems to be the only way...
>
I thought about even monitor on statement but did not try yet because
i was in doubt if this will capture optimization level information
I guess i will try and find out- Hide quoted text -
Nov 5 '08 #6
On 5 Nov, 13:18, "stefan.albert" <stefan.alb...@spb.dewrote:
This information is not in the data captured with event monitor for
statement.
Also the snapshot does not give this information.
db2pd seems to be the only way...
I thought about even monitor on statement but did not try yet because
i was in doubt if this will capture optimization level information
I guess i will try and find out- Hide quoted text -
Which DB2 release are you using?
Another way to capture and store optimization level used by queries is
the db2 audit feature; I can ensure you that on db2 v9.5 this
information is reported.
To know how to set db2 v9.5 audit , see my post on another forum:

http://www-128.ibm.com/developerwork...8701&#14158701

Regards
Salvatore Vacca
Nov 5 '08 #7
On 5 Nov, 13:18, "stefan.albert" <stefan.alb...@spb.dewrote:
This information is not in the data captured with event monitor for
statement.
Also the snapshot does not give this information.
db2pd seems to be the only way...
I thought about even monitor on statement but did not try yet because
i was in doubt if this will capture optimization level information
I guess i will try and find out- Hide quoted text -

Which DB2 release are you using?
Another way to capture and store optimization level used by queries is
the db2 audit feature; I can ensure you that on db2 v9.5 this
information is reported.
To know how to set db2 v9.5 audit , see my post on another forum:

http://www-128.ibm.com/developerwork...8701&#14158701

Regards
Salvatore Vacca
Nov 5 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Rune | last post by:
Is it best to use double quotes and let PHP expand variables inside strings, or is it faster to do the string manipulation yourself manually? Which is quicker? 1) $insert = 'To Be';...
5
by: Praveen_db2 | last post by:
Dear All Db2 version: 8.1 OS: Windows I have 2 questions: 1) What is the optimizer which db2 uses, rule based or cost based? If any one can clear out the difference between the two it will be...
14
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
93
by: roman ziak | last post by:
I just read couple articles on this group and it keeps amazing me how the portability is used as strong argument for language cleanliness. In my opinion, porting the program (so you just take the...
0
by: William M. Miller | last post by:
For a rather obscure reason, I have to compile at least part of my application with at least some level of optimization -- a certain behavior I rely on is only enabled by the optimizer. I'm...
3
by: MLM450 | last post by:
I have a control that handles the KeyDown event but it does not seem to execute when a combination of keys is pressed - like CTRL+Z. If I press CTRL, it executes. If I press Z, it executes. But the...
18
by: terminator(jam) | last post by:
consider: struct memory_pig{//a really large type: memory_pig(){ std::cout<<"mem pig default\n"; //etc... }; memory_pig(memory_pig const&){
2
by: db2admin | last post by:
hi, I have query which runs great when optimization level is changed to 3 but does not run fine with default optimization level of 5. since this is a query in java code, i do not know how can i...
20
by: Ravikiran | last post by:
Hi Friends, I wanted know about whatt is ment by zero optimization and sign optimization and its differences.... Thank you...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.