473,383 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Setting the prefetch size.

Hi,

I have a question here regarding setting the prefetch size. So far we took
the rule that for OLTP, prefetchsize = extent size and for DSS prefetchsize
= extent size * number.

However, especially due to the "Skip Scans" for indexes I started to
question this. It looks to me that for reading a index DB2 will or do a
synchronous read or he will have to scan the whole index and thus prefetch
the data correct? If this is so, then it seems to me that it would be better
for tablespaces which contain only indexes to set the prefetchsize higher
then the extent size.

Then for tablespaces just containing tables, again here it seems to me that
setting the prefetchsize higher might be better since the optimizer (again,
if I'm correct here) will limit the number of pages to be prefetched (as
seen in explain plan, MAXPAGES setting) and will not do asynchronous IO if
only a few pages need to be retrieved anyway.
I can understand that for OLTP you might not want to set your prefetchsize
as high as for DSS tablespaces, but if using multiple containers and each
container on a RAID (and PARALLEL_IO is also set) then I'm starting to get
the feeling that even for OLTP databases (in which some DSS type of activity
happens) setting the prefetchsize higher might indeed help performance.

What do other people think, experiences, ...??
Nov 12 '05 #1
1 6217
"Erik Hendrix" <he**********@hotmail.com> wrote in message
news:6f******************************@news.teranew s.com...
Hi,

I have a question here regarding setting the prefetch size. So far we took
the rule that for OLTP, prefetchsize = extent size and for DSS prefetchsize = extent size * number.

However, especially due to the "Skip Scans" for indexes I started to
question this. It looks to me that for reading a index DB2 will or do a
synchronous read or he will have to scan the whole index and thus prefetch
the data correct? If this is so, then it seems to me that it would be better for tablespaces which contain only indexes to set the prefetchsize higher
then the extent size.
I don't believe that there is any evidence that DB2 does skip-scans, but I
would prefer not to discuss that subject in this thread since it has
recently been beat to death.

Usually, the prefetch size should be the extent size times the number of
containers in the tablespace (or some higher multiple of that result).
Containers should be placed on different physical disks for optimum results.
So if the extent size is 8 pages and you have 2 containers, the optimal
prefetch sizes are 16, 32, 64 etc pages.

DB2 does sometimes do scans of the entire index where prefetch is important.
But most indexes are smaller than tables, so I am not sure that one would
use a larger prefetch for indexes than the table. Of course, if you had an
OLTP system and did not want to fill up buffer pools with tablespace scans
for the table, then that might be a different consideration.

Then for tablespaces just containing tables, again here it seems to me that setting the prefetchsize higher might be better since the optimizer (again, if I'm correct here) will limit the number of pages to be prefetched (as
seen in explain plan, MAXPAGES setting) and will not do asynchronous IO if
only a few pages need to be retrieved anyway.
I can understand that for OLTP you might not want to set your prefetchsize
as high as for DSS tablespaces, but if using multiple containers and each
container on a RAID (and PARALLEL_IO is also set) then I'm starting to get
the feeling that even for OLTP databases (in which some DSS type of activity happens) setting the prefetchsize higher might indeed help performance.

What do other people think, experiences, ...??

Prefetch will help if you have tablespaces scans of the entire table, or
start reading large continuous sections of a table where prefetch may kick
in.

If you use RAID-5, then you want one container per array, with the extent
size equal to the stripe size or some multiple of that.

Often it is good in OLTP systems to use the
OPTIMIZE FOR integer ROWS
clause. This may prevent prefetch in cases when the number of rows to be
fetched in a cursor is less than DB2 thinks. This clause does not limit the
number of rows that may be fetched, but does control the optimizer in terms
of whether prefetch may be used by DB2.
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: fleemo17 | last post by:
My organization is developing a set of "standards" for websites built inhouse. The first question that comes to mind is what would be a good standard default size for <p> text? 12 point? Which...
1
by: Li Kao | last post by:
After incrementally increasing SORTHEAP (and the commensurate increase in SHEAPTHRES) and *slightly* reducing the bufferpool size, I find that my query is no longer taking advantage of async IO for...
4
by: Erik Hendrix | last post by:
Hi, I have a quick question, when one sets the prefetch size = extent size, then when doing a backup we will have 1 agent (db2bm) doing the reads. If we have prefetch size a multiple of extent...
2
by: Jean-Marc Blaise | last post by:
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...
14
by: Roger Withnell | last post by:
How to I find out what size text the browser is set to? Thanks in anticipation.
3
by: rdudejr | last post by:
Hi all, Ive got a database approx 350 GB in which Im getting very high Time waited for prefetch. This is directly out of the snapshot for the db (these are for the entire database I assume as I...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
1
by: =?Utf-8?B?Sm9ubnk=?= | last post by:
Hi. I an pulling my hair out with this one and hope somebody can help me.I started getting a message on startuo saying windows/prefetch/explorer.exe -082F38A9.pf is corrupt.Since then every time...
8
by: Andrus | last post by:
..NET 2 Winforms application. How to create new setting and set it default value in userSettings section of app.config file or overwrite existing setting value ? I found code below in this list...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.