Topic
2 replies Latest Post - ‏2012-11-02T21:36:32Z by nivanov1
SystemAdmin
SystemAdmin
5837 Posts
ACCEPTED ANSWER

Pinned topic executeBatch statement containing delete queries is slow in db2 environment

‏2012-10-29T05:16:15Z |
Hi,

I am running a executeBatch() statement containing delete statements through java code. This batch runs very slow in db2. Also I am unable to monitor/track as in which delete statement is causing the batch to run slow.
Please help me on this.

Thanks in advance.

Regards,
Nikita
Updated on 2012-11-02T21:36:32Z at 2012-11-02T21:36:32Z by nivanov1
  • SystemAdmin
    SystemAdmin
    5837 Posts
    ACCEPTED ANSWER

    Re: executeBatch statement containing delete queries is slow in db2 environment

    ‏2012-10-29T14:46:32Z  in response to SystemAdmin
    Hello Nikita,

    Why not extracting the explain plan for these delete statements. For example, you could use the db2expln command :

    http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0005736.html

    Regards

    Yves-Antoine Emmanuelli
  • nivanov1
    nivanov1
    53 Posts
    ACCEPTED ANSWER

    Re: executeBatch statement containing delete queries is slow in db2 environment

    ‏2012-11-02T21:36:32Z  in response to SystemAdmin
    May be something like this:

    select stmt_text from table(mon_get_pkg_cache_stmt('D',null,null,null))
    order by TOTAL_CPU_TIME/NUM_EXEC_WITH_METRICS desc
    fetch first 10 rows only