Unix Technical Forum

A little question on PREFETCH / MDC

This is a discussion on A little question on PREFETCH / MDC within the DB2 forums, part of the Database Server Software category; --> Dear all, If you do a SELECT * FROM TAB WHERE DATE=?, the explain plan might pick up a ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 03:25 AM
Jean-Marc Blaise
 
Posts: n/a
Default A little question on PREFETCH / MDC

Dear all,

If you do a SELECT * FROM TAB WHERE DATE=?, the explain plan might pick up a
TBSCAN and you'll see in db2exfmt PREFETCH=SEQUENTIAL.

Now, TAB is a MDC, and DATE is a dimension. The explain plan will pick up
the block index and db2exfmt indicates PREFETCH=NONE. However, monitoring
bufferpools shows async IO is done.

Would it make sense to have db2exfmt indicate in that case
PREFETCH=SEQUENTIAL when the MDC is read from 1 dimension ? I believe all
extents will be read ahead in the order indicated by the block index ?

Regards,

Jean-Marc


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 03:26 AM
Jean-Marc Blaise
 
Posts: n/a
Default Re: A little question on PREFETCH / MDC

"Jean-Marc Blaise" <nobody@nowhere.com> a écrit dans le message de
news:425c0bd5$0$829$8fcfb975@news.wanadoo.fr...
> Dear all,
>
> If you do a SELECT * FROM TAB WHERE DATE=?, the explain plan might pick up

a
> TBSCAN and you'll see in db2exfmt PREFETCH=SEQUENTIAL.
>
> Now, TAB is a MDC, and DATE is a dimension. The explain plan will pick up
> the block index and db2exfmt indicates PREFETCH=NONE. However, monitoring
> bufferpools shows async IO is done.
>
> Would it make sense to have db2exfmt indicate in that case
> PREFETCH=SEQUENTIAL when the MDC is read from 1 dimension ? I believe all
> extents will be read ahead in the order indicated by the block index ?
>
> Regards,
>
> Jean-Marc
>

I have found this in the DB2 Information Center:

"Second, prefetching of the data pages does not rely on sequential detection
when block indexes are used. DB2 UDB looks ahead in the index, prefetching
the data pages of the blocks into memory using big-block I/O, and ensuring
that the scan does not incur the I/O when the data pages are accessed in the
table."

I understand from this that "block prefetching" is always done due to MDC.

Improvment request: it should be nice to externalize this in explains, why
not PREFETCH=BLOCK instead of NONE ?

Jean-Marc


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 03:26 AM
Fan Ruo Xin
 
Posts: n/a
Default Re: A little question on PREFETCH / MDC


"Jean-Marc Blaise" <nobody@nowhere.com> wrote in message
news:425c2513$0$3103$8fcfb975@news.wanadoo.fr...
> "Jean-Marc Blaise" <nobody@nowhere.com> a écrit dans le message de
> news:425c0bd5$0$829$8fcfb975@news.wanadoo.fr...
> > Dear all,
> >
> > If you do a SELECT * FROM TAB WHERE DATE=?, the explain plan might pick

up
> a
> > TBSCAN and you'll see in db2exfmt PREFETCH=SEQUENTIAL.
> >
> > Now, TAB is a MDC, and DATE is a dimension. The explain plan will pick

up
> > the block index and db2exfmt indicates PREFETCH=NONE. However,

monitoring
> > bufferpools shows async IO is done.
> >
> > Would it make sense to have db2exfmt indicate in that case
> > PREFETCH=SEQUENTIAL when the MDC is read from 1 dimension ? I believe

all
> > extents will be read ahead in the order indicated by the block index ?
> >
> > Regards,
> >
> > Jean-Marc
> >

> I have found this in the DB2 Information Center:
>
> "Second, prefetching of the data pages does not rely on sequential

detection
> when block indexes are used. DB2 UDB looks ahead in the index, prefetching
> the data pages of the blocks into memory using big-block I/O, and ensuring
> that the scan does not incur the I/O when the data pages are accessed in

the
> table."
>
> I understand from this that "block prefetching" is always done due to MDC.
>
> Improvment request: it should be nice to externalize this in explains, why
> not PREFETCH=BLOCK instead of NONE ?

============
When I used DB2 UDB Version 8.1 GA (or fixpak1). I couldn't find the block
I/O information either, when I took a look at the explain output.
I know my query did using block I/O, since I found that information from
snapshot output.
I never try it by using the late release.

>
> Jean-Marc
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:22 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com