Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    120

    Unanswered: query log and query plan

    Hi all,
    I'm planning the test execution on our product which is based on Db2 9.7.4, and I'd like to do the following:

    - collect all the query executed from my product
    - collect query plan for some of them
    - compare query plans for same queries run by the various product versions

    My product uses ODBC 3.0 to talk with the db.

    For the first item I was thinking of creating an EVENT MONITOR FOR STATEMENTS, but is there a way to filter the statements coming from my ODBC application? Could I use better ODBC trace?

    For the second and third, I was thinking to EXPLAIN, but is there an output that is easily comparable?
    As I said I'd like to be able to automatically compare the query plan for same query obtained in 2 different times.

    Last question: would it be possible to compare a query plan for the same ODBC query run against DB2 and SQL Server? Some products should do this, but are not free, so I was wondering if there's a smart way to do that.

    Thanks

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by Robert1973 View Post

    For the first item I was thinking of creating an EVENT MONITOR FOR STATEMENTS, but is there a way to filter the statements coming from my ODBC application?
    You can filter statement events by the application name or authorization ID, as shown in the manual.

    Quote Originally Posted by Robert1973 View Post
    For the second and third, I was thinking to EXPLAIN, but is there an output that is easily comparable?
    As I said I'd like to be able to automatically compare the query plan for same query obtained in 2 different times.
    EXPLAIN populates explain tables; you can write a query against those tables to compare whatever metrics you think you need to compare.

    Quote Originally Posted by Robert1973 View Post
    would it be possible to compare a query plan for the same ODBC query run against DB2 and SQL Server?
    Why would you want to do that?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •