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.
阅读(1456) | 评论(0) | 转发(0) |