Adaption is good!

RDBMS from IBM and IBM's Hierarchical DBMS and Transaction Manager (IMS DC).
Post Reply
Quasar Chunawala
Registered Member
Posts: 34
Joined: Sun Aug 11, 2013 4:48 pm
Location: Pune

Adaption is good!

Post by Quasar Chunawala »

Hi all,

Reading about DB2 internals and performance metrics has always been my favourite topic of interest. I recently read a column on Sequential Prefetch, one of the coolest features of DB2. DB2 can asynchronously read consecutive pages of data, if DB2 thinks you are likely to read pages sequentially. With a pre-fetch size of n pages, once you read (n/2)th page, DB2 triggers the next pre-fetch. I also know, that the DB2 optimizer decides to use Sequential Pre-fetch at BIND time.

With DB2 V9, dynamic pre-fetch feature makes it possible to switch from indexed-access to sequential pre-fetch on-the-fly. There are no dumb questions, so I'd like to ask, does this access path change reflect in the PLAN_TABLE? As an application programmer, how would I detect, if dynamic pre-fetch was leveraged?

Thanks,
Quasar C.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Adaption is good!

Post by Anuj Dhawan »

does this access path change reflect in the PLAN_TABLE? As an application programmer, how would I detect, if dynamic pre-fetch was leveraged?
I don't think so that "change", as such, will reflect. Because to see if the DB2 optimizer has chosen a prefetch access method, with EXPLAIN you'd look at the rows of data in your PLAN_TABLE as you've suspected. The PREFETCH column should have "D" for dynamic fetch. However, if the statistics aren't up to date, the PREFETCH column value may be "S" - said that, DB2 still detects whether the data is truly being processing sequentially.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Adaption is good!

Post by Anuj Dhawan »

Also, in DB2 10 for z/OS, the Dynamic Prefetch detection process becomes more row oriented rather than detecting purely if pages (DB2 9) are accessed sequentially.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Quasar Chunawala
Registered Member
Posts: 34
Joined: Sun Aug 11, 2013 4:48 pm
Location: Pune

Re: Adaption is good!

Post by Quasar Chunawala »

Good insight - thanks Anuj! :)
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Adaption is good!

Post by Anuj Dhawan »

You're welcome! :)
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DB2 and IMS DB/DC”