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

SQL compiler and buffer pool

I have a database DB2 v8.1.1.112 on AIX 5.2
With the following BP.
select BUFFERPOOLID, NPAGES,PAGESIZE from syscat.bufferpools

BPNAME NPAGES PAGESIZE
------------ ----------- -----------
IBMDEFAULTBP 512 4096
BP_4K 444 4096
BP04K01 1044 4096
The user tbs is on BufferPool 3
System tbs is on BufferPool 1

The result from db2batch
Prepare Time is: 0.000 seconds
Execute Time is: 0.043 seconds
Fetch Time is: 0.864 seconds
Elapsed Time is: 0.908 seconds

If the BufferPool 2 is altered by
ALTER BUFFERPOOL BP_4K IMMEDIATE SIZE 444

Prepare Time is: 90.207 seconds
Execute Time is: 0.048 seconds
Fetch Time is: 1.652 seconds
Elapsed Time is: 91.907 seconds

What is the sql compiler doing with the unused BufferPool?

May 18 '07 #1
3 2918
On May 18, 4:02 pm, shenan...@gmail.com wrote:
I have a database DB2 v8.1.1.112 on AIX 5.2
With the following BP.
select BUFFERPOOLID, NPAGES,PAGESIZE from syscat.bufferpools

BPNAME NPAGES PAGESIZE
------------ ----------- -----------
IBMDEFAULTBP 512 4096
BP_4K 444 4096
BP04K01 1044 4096

The user tbs is on BufferPool 3
System tbs is on BufferPool 1

The result from db2batch
Prepare Time is: 0.000 seconds
Execute Time is: 0.043 seconds
Fetch Time is: 0.864 seconds
Elapsed Time is: 0.908 seconds

If the BufferPool 2 is altered by
ALTER BUFFERPOOL BP_4K IMMEDIATE SIZE 444

Prepare Time is: 90.207 seconds
Execute Time is: 0.048 seconds
Fetch Time is: 1.652 seconds
Elapsed Time is: 91.907 seconds

What is the sql compiler doing with the unused BufferPool?
Those allocations are pitifully small. Just for starters, set each
bufferpool to 10,000 pages and restart instance.

May 19 '07 #2
Ian
sh*******@gmail.com wrote:
I have a database DB2 v8.1.1.112 on AIX 5.2
With the following BP.
select BUFFERPOOLID, NPAGES,PAGESIZE from syscat.bufferpools

BPNAME NPAGES PAGESIZE
------------ ----------- -----------
IBMDEFAULTBP 512 4096
BP_4K 444 4096
BP04K01 1044 4096
The user tbs is on BufferPool 3
System tbs is on BufferPool 1

The result from db2batch
Prepare Time is: 0.000 seconds
Execute Time is: 0.043 seconds
Fetch Time is: 0.864 seconds
Elapsed Time is: 0.908 seconds

If the BufferPool 2 is altered by
ALTER BUFFERPOOL BP_4K IMMEDIATE SIZE 444

Prepare Time is: 90.207 seconds
Execute Time is: 0.048 seconds
Fetch Time is: 1.652 seconds
Elapsed Time is: 91.907 seconds

What is the sql compiler doing with the unused BufferPool?
The key is seeing that prepare time originally was 0.000 seconds.
Which almost certainly means you had a package cache hit.

When you alter the bufferpool, DB2 invalidates any cached access
plans in the package cache, so the next prepare will require that
the access plan be compiled again.

If you run db2batch again after the 90 second prepare time, do you
see the time decrease to near zero again?
May 19 '07 #3
On May 19, 5:42 pm, Ian <ianb...@mobileaudio.comwrote:
shenan...@gmail.com wrote:
I have a database DB2 v8.1.1.112 on AIX 5.2
With the following BP.
select BUFFERPOOLID, NPAGES,PAGESIZE from syscat.bufferpools
BPNAME NPAGES PAGESIZE
------------ ----------- -----------
IBMDEFAULTBP 512 4096
BP_4K 444 4096
BP04K01 1044 4096
The user tbs is on BufferPool 3
System tbs is on BufferPool 1
The result from db2batch
Prepare Time is: 0.000 seconds
Execute Time is: 0.043 seconds
Fetch Time is: 0.864 seconds
Elapsed Time is: 0.908 seconds
If the BufferPool 2 is altered by
ALTER BUFFERPOOL BP_4K IMMEDIATE SIZE 444
Prepare Time is: 90.207 seconds
Execute Time is: 0.048 seconds
Fetch Time is: 1.652 seconds
Elapsed Time is: 91.907 seconds
What is the sql compiler doing with the unused BufferPool?

The key is seeing that prepare time originally was 0.000 seconds.
Which almost certainly means you had a package cache hit.

When you alter the bufferpool, DB2 invalidates any cached access
plans in the package cache, so the next prepare will require that
the access plan be compiled again.

If you run db2batch again after the 90 second prepare time, do you
see the time decrease to near zero again?
Thanks Ian and Mark.
The second db2batch run do see the package cache.
The default BP size if not a problem here, the testing database is
only 40MB.
The query here is 9 table join, it will take sometime for DB2 to
compile.

The first db2batch run when BP_4K = 444
Prepare Time is: 10.465 seconds
Execute Time is: 0.050 seconds
Fetch Time is: 0.611 seconds
Elapsed Time is: 11.126 seconds

The first db2batch run when BP_4K = 443
Prepare Time is: 0.060 seconds
Execute Time is: 0.040 seconds
Fetch Time is: 0.661 seconds
Elapsed Time is: 0.761 seconds

Why a smaller unused BP has such a big implact on Compile time?
When the package cache is full, DB2 has to recompile. It is still a
big performance issue take such a long time on compile.

May 22 '07 #4

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

Similar topics

8
by: Tron Thomas | last post by:
As part of applying for a programming position at a company, I recently I had submitted some code samples to one of the developers for review. This is the feedback I received: One of his...
6
by: Mark | last post by:
If you have STL containers (like list, vector,...) in functions as automatic variables, do the nodes that are put on the containers get buffered so they can be reused by later container...
7
by: eric | last post by:
Hi there, BP hit ratio = 1 - (BP physical reads / BP logical reads). If all the BP physical reads are asynchronous, it should mean that the pages are brought up to the bufferpool before the...
6
by: Mark | last post by:
I understand the concept of catalog cache (memory allocated from the dbheap to allow catalog lookups without the need to access disk each time). But the DB2 catalog tablespace (SYSCATSPACE) is...
3
by: Mark | last post by:
In a DB2 V8.1 performance tuning document from a 3rd party vendor, I found this statement. Can anyone verify this? "DB2 requires 100 bytes of memory for every buffer pool and extended storage...
2
by: Kush | last post by:
Hi. I am kind of new to DB2 and to this newsgroup so please bear with me.. My question is: IBM installation creates 250 4k bufferpools by default. I want to increase this number to 1000, no...
6
by: xeqister | last post by:
Greetings, We are having a situation here whereby one of our staff created a very huge 32K buffer pool in a production database and caused the database to go down. When we try to reconnect to the...
0
by: jorge_martelanz | last post by:
I would like to receive experiences/ideas/recomendations/etc. from the community about commercial tools available to tune bufferpools in DB2 for z/OS I am aware of: - BPA4DB2 by ESAI - Buffer...
6
by: Angel Tsankov | last post by:
Hi, I remember reading in a book (or in an article) that the optmial buffer growth factor is about 1.6. Now I need to find this book but I can't remember its title. Can someone help me with this?
4
by: Patrick Finnegan | last post by:
Is there a DB2 setting that will force a table to be cached in the buffer pool? We have four tables that we want to cache completely in the buffer pool to ensure that all the data is read from...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.