Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Repeating query not running faster

Repeating query not running faster

Repeating query not running faster

Running DB2 101 fp2 on Red Hat Linux.

We have a query that repeats several times consecutively. The issue is that the subsequent execution times are not running faster than the first execution. I would think that the explain plan, once in the sql cache, would enable quicker times on subsequent executions.

Is there anything I can do to help subsequent executions run quicker?

Thanks in advance.

RE: Repeating query not running faster

creating and caching the plan takes just a few miliseconds - unless your query runs under a second you won't really notice any difference.

In any case post the sql here, alongside the number of records of each table used and all the indexes each table has and maybe we can give some hints


Frederico Fonseca
SysSoft Integrated Ltd

FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

RE: Repeating query not running faster

Thanks for the reply. The sql I was provided by the app team is not correct. If I can get them to provide me with the right sql I will post.


RE: Repeating query not running faster

I recall that DB2 uses a setting that allows the db to take less or more time to spend on creating the most optimized explain. I forgot the name of this parameter, but setting it to a higher value would only be beneficial for complex queries. The range I recall went from 1 to 9

Ties Blom

RE: Repeating query not running faster

If the repeated query uses different predicate info and returns differing rows, why would better improvement be anticipated?

If the repeated query processes the same input rows and produces the same results, some improvement might be seen due to a reduced number of I/O - data still in the buffers and not re-read.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close