Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2089227
  • 博文数量: 519
  • 博客积分: 10070
  • 博客等级: 上将
  • 技术积分: 3985
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-29 14:05
个人简介

只问耕耘

文章分类

全部博文(519)

文章存档

2016年(1)

2013年(5)

2011年(46)

2010年(220)

2009年(51)

2008年(39)

2007年(141)

2006年(16)

我的朋友

分类:

2008-12-17 18:40:22

Prior to DB2 9 any non long data types (i.e. not blobs, clobs or long varchar) were stored in "regular" tablespaces. Data stored in these tablespaces always had a 4 byte record identifier known as a RID. The 4 bytes are made up of a 3 byte page number and a 1 byte slot number. The slot number is the offset within the data page where the row exists and the page number identifies the page on which that row resides. Using this size of RID meant that a single table partition could only be 512GB in size if the page size was 32k and only 64GB in size if the page size was 4k.
New in DB2 9 is a larger RID. For tablespaces that are defined as large, the RID is now 6 bytes. That is 4 bytes for the page number and 2 bytes for the slot number. Now you can have data pages that contain more than 255 rows (that was the old limit with the old rid) and you can have a single table partition that is 2TB in size even with a 4k page size (and up to 16TB per partition for a 32k page size). Also note that this new large tablespace is the default for any DMS tablespace you create and it's also the default for the new Automatic Storage tablespaces in DB2 9.
The result is that tables can now be ridiculously large. I say ridiculous because no one has this much data (today). To calculate the largest single table you can now have in DB2, first take the largest page size (32k) which supports a single table partition of 16TB in size. Then multiply by the number of table partitions that you can have which is 32,000, and then multiply by the number of database partitions you can have in a DPF cluster (1000). That puts the largest DB2 table that you can have in DB2 9 at half a zettabyte. Yup that's a real word which represents one sextillion bytes (ya that's a real word as well). That's 512,000 Petabytes for just a single table. How crazy is that…if you gave every man, women and child on the planet (all six billion of them) an 85GB drive, had them fill it up full, then collected them all back, you could store all that data in a single table in DB2 (assuming you build a system that could hold that many drives :-)
The important thing here is that if you use compression in DB2 9 then you probably want to also make sure you are using large rids. Why? Well in many cases the rows will shrink down quite small and the chances that you can fit more than 255 rows on a page will probably be quite high. So use large tablespaces in DB2 9 and you can store many more rows per page.
In my next posting I'll talk about how to convert you existing regular tablespaces to large tablespaces.
http://it.toolbox.com/blogs/db2luw/large-tablespaces-the-default-in-db2-9-13187
阅读(1460) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~