473,395 Members | 1,948 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,395 software developers and data experts.

Preloading data/table in memory?


Folks,

I am using DB2 UDB 8.1 on RedHat ES 2.1. In order to improve performance
of one of our table, I would like to preload some or all of the data into
memory when I start DB2.

Is there a way to do it?
Thanks.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #1
10 7748
Hemant Shah wrote:
Folks,

I am using DB2 UDB 8.1 on RedHat ES 2.1. In order to improve performance
of one of our table, I would like to preload some or all of the data into
memory when I start DB2.

Is there a way to do it?
Thanks.

That should be easy enough.
Create a bufferpool big enough for the table.
Create a tablespace fo rtehat bufferpool
place the table in that tablespace.
Provoke a scan after starting up DB2.
E.g. SELECT COUNT(DISTINCT *) FROM T;

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #2
"Serge Rielau" <sr*****@ca.ibm.com> wrote in message
news:36*************@individual.net...
That should be easy enough.
Create a bufferpool big enough for the table.
Create a tablespace fo rtehat bufferpool
place the table in that tablespace.
Provoke a scan after starting up DB2.
E.g. SELECT COUNT(DISTINCT *) FROM T;

Cheers
Serge


Don't forget about the index(es) for the table. If the table is very
important, then all of its indexes should be in memory also (unless the
table is so small that the indexes would not be used by DB2.
Nov 12 '05 #3
The question should be -
Do you want to increase the response time of the whole system ?
or
Do you want ot speed up the response time for one peticular sql stmt?
Both questions might involve to improve performance of one special table.
BTW, db2 will not suggest you always cache one physical table or index. DB2
server's memory control manager has some algorithm to decide the age of each
data page and figure out which one supposed to be out. Most of time, it
would not help if you try to tell db2 server how to ....

"Hemant Shah" <sh**@typhoon.xnet.com> wrote in message
news:cu**********@new7.xnet.com...

Folks,

I am using DB2 UDB 8.1 on RedHat ES 2.1. In order to improve performance
of one of our table, I would like to preload some or all of the data into
memory when I start DB2.

Is there a way to do it?
Thanks.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.

Nov 12 '05 #4
While stranded on information super highway Fan Ruo Xin wrote:
The question should be -
Do you want to increase the response time of the whole system ?
or
Do you want ot speed up the response time for one peticular sql stmt?
Both questions might involve to improve performance of one special table.
BTW, db2 will not suggest you always cache one physical table or index. DB2
server's memory control manager has some algorithm to decide the age of each
data page and figure out which one supposed to be out. Most of time, it
would not help if you try to tell db2 server how to ....

This is a readonly table. It contain acturial (sp?) data. There are certain
transactions that read different subset of the table over and over again to
perform calculations. If the whole table is in memory then there is no I/O
latency like getting data from the disk.

"Hemant Shah" <sh**@typhoon.xnet.com> wrote in message
news:cu**********@new7.xnet.com...

Folks,

I am using DB2 UDB 8.1 on RedHat ES 2.1. In order to improve performance
of one of our table, I would like to preload some or all of the data into
memory when I start DB2.

Is there a way to do it?
Thanks.

--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.



--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #5
While stranded on information super highway Serge Rielau wrote:
Hemant Shah wrote:
Folks,

I am using DB2 UDB 8.1 on RedHat ES 2.1. In order to improve performance
of one of our table, I would like to preload some or all of the data into
memory when I start DB2.

Is there a way to do it?
Thanks.
That should be easy enough.
Create a bufferpool big enough for the table.
Create a tablespace fo rtehat bufferpool
place the table in that tablespace.
Provoke a scan after starting up DB2.
E.g. SELECT COUNT(DISTINCT *) FROM T;


Thanks I will try that. I already have seperate bufferpool and table space
for the table.

The table has 354677 rows and each row will not be more then 3100 bytes.

I have defined a bufferpool of 10000 pages, each page is 32k.

"create bufferpool planfilepool size 10000 pagesize 32k"

I will have to increase the size of the bufferpool.

Do I need to create buffer pool with 4K pages because each row will be less
then 4K, so will 32K pagesize work with the table?

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #6
While stranded on information super highway Mark A wrote:
"Serge Rielau" <sr*****@ca.ibm.com> wrote in message
news:36*************@individual.net...
That should be easy enough.
Create a bufferpool big enough for the table.
Create a tablespace fo rtehat bufferpool
place the table in that tablespace.
Provoke a scan after starting up DB2.
E.g. SELECT COUNT(DISTINCT *) FROM T;

Cheers
Serge
Don't forget about the index(es) for the table. If the table is very
important, then all of its indexes should be in memory also (unless the
table is so small that the indexes would not be used by DB2.


How do I load index in the memory?

There is only one index on the table and it is a unique index.



--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #7
Hemant Shah wrote:
The table has 354677 rows and each row will not be more then 3100 bytes.

I have defined a bufferpool of 10000 pages, each page is 32k.

"create bufferpool planfilepool size 10000 pagesize 32k"

I will have to increase the size of the bufferpool.

Do I need to create buffer pool with 4K pages because each row will be
less then 4K, so will 32K pagesize work with the table?


The page size of the buffer pool must match with the page size of the
tablespace in which you placed the table in question.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #8
While stranded on information super highway Knut Stolze wrote:
Hemant Shah wrote:
The table has 354677 rows and each row will not be more then 3100 bytes.

I have defined a bufferpool of 10000 pages, each page is 32k.

"create bufferpool planfilepool size 10000 pagesize 32k"

I will have to increase the size of the bufferpool.

Do I need to create buffer pool with 4K pages because each row will be
less then 4K, so will 32K pagesize work with the table?
The page size of the buffer pool must match with the page size of the
tablespace in which you placed the table in question.


Yes, the pagesize of the tablespace and the bufferpool are the same.

So, I assume that the row size of the table does not matter, as long as the
pagesize of the bufferpool and the table space match.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena


--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: No************@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
Nov 12 '05 #9
Hemant Shah wrote:
While stranded on information super highway Knut Stolze wrote:
Hemant Shah wrote:

The table has 354677 rows and each row will not be more then 3100 bytes.

I have defined a bufferpool of 10000 pages, each page is 32k.

"create bufferpool planfilepool size 10000 pagesize 32k"

I will have to increase the size of the bufferpool.

Do I need to create buffer pool with 4K pages because each row will be
less then 4K, so will 32K pagesize work with the table?


The page size of the buffer pool must match with the page size of the
tablespace in which you placed the table in question.

Yes, the pagesize of the tablespace and the bufferpool are the same.

So, I assume that the row size of the table does not matter, as long as the
pagesize of the bufferpool and the table space match.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena


I would go for 32K, less overhead.

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #10
Hemant Shah wrote:
While stranded on information super highway Mark A wrote:
"Serge Rielau" <sr*****@ca.ibm.com> wrote in message
news:36*************@individual.net...
That should be easy enough.
Create a bufferpool big enough for the table.
Create a tablespace fo rtehat bufferpool
place the table in that tablespace.
Provoke a scan after starting up DB2.
E.g. SELECT COUNT(DISTINCT *) FROM T;

Cheers
Serge


Don't forget about the index(es) for the table. If the table is very
important, then all of its indexes should be in memory also (unless the
table is so small that the indexes would not be used by DB2.

How do I load index in the memory?

There is only one index on the table and it is a unique index.

Same approach as for the table. As long as the bufferpool holds the
whole beast it's stick (unless your OS memory pages of course).
I woudln't worry somuch about pre-heating it... The first usage will
bring it in.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #11

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

Similar topics

22
by: Fabian | last post by:
var preload1 = new Image(); preload1.src = "/pic/yay.gif"; var preload2 = new Image(); preload2.src = "/pic/nay.gif"; The above is meant to preload image files, yes? Problem is, it doesnt seem...
6
by: michaaal | last post by:
Is this the correct way to preload an image...? Var Image1 = new Image() ....And then when I'm ready to use the image I can do this...? Button1.src=Image1.src ....Or am I just telling...
2
by: windandwaves | last post by:
Hi Gurus Preloading images has got to be JS 101. However, it does not seem to be working. Here is the function that I am using. I added the alerts to make sure it is working and all the right...
40
by: Geoff Cox | last post by:
Hello, I am still having problems - apologies if the answer is in previous postings! I now have, in the header, <sctipt> var myimages=new Array();
3
by: giladg22 | last post by:
Hi All, I need some help resolving a pretty tricky problem. I have a javascript application running from a CD. The script preloads between 500 to 1000 jpegs (about 40K each) to the IE. The IE...
5
by: rAinDeEr | last post by:
Hi, I have a web application with a table to store terms and conditions of a Company. This may some times run into many pages and some times it may be just a few sentences. It is a character...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
7
by: Keith Hughitt | last post by:
Hi all, I am having trouble preloading images in a javascript application, and was wondering if anyone had any suggestions. Basically I have a bunch of images stored in a database as BLOBs. At...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.