If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 page sizes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-19-11, 06:47
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
DB2 page sizes

Hi,
I was just looking through the DB2 pages sizes.

IBM Informix Dynamic Server v10 Information Center

This states:
"DB2 supports 4K, 8K, 16K, and 32K page sizes."

I would have thought this was pretty small.

Windows OS defaults page size to be equal to the amount of memory on your PC.

I am curious as to why the page size is small for databases. Or is it that the page size associate with and OS and a database are two entirely different concepts?
Reply With Quote
  #2 (permalink)  
Old 07-19-11, 06:51
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
how can a page size be equal to memory size
you mean something else - swap file - paging size .. ????
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 07-19-11, 06:59
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Sorry, I am bit confused

Basically, I do not understand excatly what is meant by "page size" in DB2 lexion? And I do not understand why it is so small?

I did a wikipedia on page size Page (computer memory) - Wikipedia, the free encyclopedia and it gave the windows example.

Any advice appreciated.
Reply With Quote
  #4 (permalink)  
Old 07-19-11, 07:02
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
page is an entity used to save data/indexes.. on
they are chained together in a table / index
all pages on any system are of these sizes
see also
pagesize - Database default page size
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 07-19-11, 07:04
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
it might be a good idea to have a look at
FREE ebook - Database fundamentals - Wikis
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #6 (permalink)  
Old 07-19-11, 07:11
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
That book is pretty basic. I'm not bad

What exactly is the difference between page size and buffer pools? And why is page size so small? The page size setting for db2 are far smaller than say what your memory (i.e. RAM) would be.

Cheers.
Reply With Quote
  #7 (permalink)  
Old 07-19-11, 07:22
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Ok. Some more googling...

Good simple definition here:
Database Page Layout

Essentially saying a table / index is stored as an index of pages.

Similar a good analogy here where one poster describes them as just been like pages of a book:
database - MySQL: What is a page? - Stack Overflow

This is a good analogy as pages are of fixed size. And you can imagine if a pagesize was too big, there'd be plenty of wasted space. If page size was too small, the book would be too difficult to read / search etc.

So my questions are:
1. What are page sizes generally so small? Why can't I have a page size of say 1Meg or 100 Meg?
2. What happens if you have a very large rows (not to hard to beat size of 32KB) ? I presume your row is stored in multiple pages.
3. Also, I see DB2 has a concept of leaf pages and sequential pages and just pages. I can make a guess at what these mean, but would really like to know exactly what they mean and have a deep understanding.

So determines if a page is leaf / sequential or not? How do I check?
Do pages have children and a leaf just has no children?

Cheers.

Last edited by Breako; 07-19-11 at 07:27.
Reply With Quote
  #8 (permalink)  
Old 07-19-11, 07:31
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Here is some info on leaf / non - leaf pages for indexes: IBM Information Management Software for z/OS Solutions Information Center.

It explain the usual tree / leaf structure - widespread in Computer science. But
the question is why are leafs even needed?
Reply With Quote
  #9 (permalink)  
Old 07-19-11, 07:37
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
page size is not something invented by db2 - it is common for all applications on each platform and yes 4K.. is a regular size as it always used to be
leaf pages are being used in index structures.. these are the pages at lowest level, where the index values are being saved
there is no difference between data/index pages
sequential pages : never seen this terminology : pages are chained in a table / index and there are special pages, keeping info about pages
long objects are saved in long tablespaces where many pages are chained to create a large page.
another page would be
IBM developerWorks : DB2 9 Fundamentals certification 730 prep series
or have a look at the dba certification handbook to understand db2..
or just attend some courses..
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #10 (permalink)  
Old 07-19-11, 08:40
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Yes, I get pagesize is not something invented by DB2. I've read through the DB2 fundamentals links. The stuff I am looking is a bit more advanced.

Cheers.
Reply With Quote
  #11 (permalink)  
Old 07-19-11, 09:58
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
before going to advanced stuff it is better to understand the basics. at that time you might have a better look at the advanced chapters.
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #12 (permalink)  
Old 07-19-11, 10:13
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
Quote:
Originally Posted by przytula_guy View Post
before going to advanced stuff it is better to understand the basics. at that time you might have a better look at the advanced chapters.
There's nothing in the DB2 fundamentals book about the level of information I am looking for regarding page sizes.

Cheers.
Reply With Quote
  #13 (permalink)  
Old 07-19-11, 10:48
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
You are confusing Page File size in Windows with Page Size in a database. Page File is the Windows name for the swap file size of the entire operatiing system, not the page size used by an application running on that application.

MS SQL Server database (which only runs on Windows) has similar page sizes as DB2.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #14 (permalink)  
Old 07-19-11, 10:53
Breako Breako is offline
Registered User
 
Join Date: Jan 2006
Posts: 119
I get that.

What are page sizes generally so small? Why can't I have a page size of say 1Meg or 100 Meg?
Reply With Quote
  #15 (permalink)  
Old 07-19-11, 11:00
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Quote:
Originally Posted by Breako View Post
I get that.

What are page sizes generally so small? Why can't I have a page size of say 1Meg or 100 Meg?
You mean why doesn't the database allow that? Several reasons:
  1. Most operating systems move data from disk to memory in 4K or 8K chunks at a time. This may be changing with newer operating systems that support Huge Pages, but that is the original reason for it.
  2. It is unlikely to make your database run any faster, especially if you have enough memory such that data stays in memory, and is not constantly being moved from disk to memory.
  3. When you want only one row returned via an SQL statement, and it happens to be on disk, you don't want to have to read from disk and move to memory a huge page size that could hold thousands or rows when you only need the one row.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On