473,788 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MDC+partitionin g+compression

Hi, All

I have strange situation with table design for DB2 9.1 on Windows

I have 3 tables with same structure :

1 table - is MDC
2 table - is partitioned MDC table
3 table - is compressed partitioned MDC table
Each table in separate DMS tablespace

Im loading in every table 3,6 million rows and see the next picture :

1. MDC table have size of 122 Mb
2. partitioned MDC table have size of 1340 Мб !! (very big!!)
3. compressed partitioned MDC table (after REORG TABLE
....RESETDICTIO NARY)
have size 2680 Mb !!!! (double size!!!)

It's very strange.....
Can anybode comment this situation for me ?

P.S. Sorry for my english. :-(

Sep 15 '06 #1
8 3062
mitek wrote:
Hi, All

I have strange situation with table design for DB2 9.1 on Windows

I have 3 tables with same structure :

1 table - is MDC
2 table - is partitioned MDC table
Do you mean "database partitioning" or "table partitioning"? (But I don't
think this would make a difference here.)
3 table - is compressed partitioned MDC table
Each table in separate DMS tablespace

Im loading in every table 3,6 million rows and see the next picture :

1. MDC table have size of 122 Mb
2. partitioned MDC table have size of 1340 Мб !! (very big!!)
What are your clustering columns and how many distinct tuples do you have on
those? Because: if you use a unique column (e.g. primary key) then each
row will go to its own cluster. And that implies that each cluster has 1
extent allocated and only 1 row on the pages in this extent. Thus, if you
have too many clusters (which could be made worse with the partitioning
since each partition has its own, independent clusters), you will see a lot
of disk space being needed.

How did you measure the size of the tables?

p.s: I don't know enough about compression (yet) to comment an that part.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 15 '06 #2
Knut Stolze wrote:
mitek wrote:
>Hi, All

I have strange situation with table design for DB2 9.1 on Windows

I have 3 tables with same structure :

1 table - is MDC
2 table - is partitioned MDC table

Do you mean "database partitioning" or "table partitioning"? (But I don't
think this would make a difference here.)
>3 table - is compressed partitioned MDC table
Each table in separate DMS tablespace

Im loading in every table 3,6 million rows and see the next picture :

1. MDC table have size of 122 Mb
2. partitioned MDC table have size of 1340 Мб !! (very big!!)

What are your clustering columns and how many distinct tuples do you have on
those? Because: if you use a unique column (e.g. primary key) then each
row will go to its own cluster. And that implies that each cluster has 1
extent allocated and only 1 row on the pages in this extent. Thus, if you
have too many clusters (which could be made worse with the partitioning
since each partition has its own, independent clusters), you will see a lot
of disk space being needed.
I can only re-enforce what Knut is stating.
If you end up with near empty extends you get a situation like vacuum in
space. A whole lot of nothing.
When you apply partitioning in addition to MDC you will need to make
your MDC more coarse.
A good thumb rule by which I like to operate is to aim for no more than
20% growth when making a table MDC.
If you have extremely many ranges on a small table you may observe the
same effect. Keep in mind that each range will have, on average one half
full extend in a perfectly reorg-ed table.
If you have 10000 ranges * 128KB extend size / 2 (half full). That is a
sizable number.

If you pass along your design and the expected number of rows we can
certainly comment.

W.r.t. compression, each range will have it's own dictionary. If your
ranges are very small I could imagine the effect you are seeing.
Also compression will have no effect if your extends are mostly empty
anyway. Vaccuum doesn't shrink when you compress the few lost atoms
inside of it.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 15 '06 #3
Serge Rielau wrote:
W.r.t. compression, each range will have it's own dictionary.
This could actually double the needed disk space? Where is the dictionary
stored in an partitioned MDC? Inquiring mind wants to know...

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 15 '06 #4
Knut Stolze wrote:
Serge Rielau wrote:
>W.r.t. compression, each range will have it's own dictionary.

This could actually double the needed disk space? Where is the dictionary
stored in an partitioned MDC? Inquiring mind wants to know...
MDC is is still one table.
Each range partition is its own physical table.
Hence the duplication of dictionaries.
The same holds true for database partitions in DPF. Dictionaries are per
node.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 15 '06 #5
Serge Rielau wrote:
Knut Stolze wrote:
>Serge Rielau wrote:
>>W.r.t. compression, each range will have it's own dictionary.

This could actually double the needed disk space? Where is the
dictionary
stored in an partitioned MDC? Inquiring mind wants to know...
MDC is is still one table.
Each range partition is its own physical table.
Hence the duplication of dictionaries.
The same holds true for database partitions in DPF. Dictionaries are per
node.
All right. So it's the partitioning and not the MDC stuff that results in
multiple dictionaries. That makes a lot of sense. But then: is the 2x
increase in space consumption in the range of possibilities?

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 15 '06 #6
Knut Stolze wrote:
Serge Rielau wrote:
>Knut Stolze wrote:
>>Serge Rielau wrote:

W.r.t. compression, each range will have it's own dictionary.
This could actually double the needed disk space? Where is the
dictionary
stored in an partitioned MDC? Inquiring mind wants to know...
MDC is is still one table.
Each range partition is its own physical table.
Hence the duplication of dictionaries.
The same holds true for database partitions in DPF. Dictionaries are per
node.

All right. So it's the partitioning and not the MDC stuff that results in
multiple dictionaries. That makes a lot of sense. But then: is the 2x
increase in space consumption in the range of possibilities?
I have no reason to disbelieve it, but no desire to run a formal proof.
Compression is very effective for non pathological cases. That's what
counts. The highest ratio reported to us by a customer is 86%.
This case is already pathological without throwing compression into the
mix. No need to waste time on it as far as I am concerned.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 15 '06 #7


Hi, Knut. Thanx for reply.
>
Do you mean "database partitioning" or "table partitioning"? (But I don't
think this would make a difference here.)
This is non DPF, only table partitioning.
>
What are your clustering columns and how many distinct tuples do you have on
those? Because: if you use a unique column (e.g. primary key) then each
row will go to its own cluster. And that implies that each cluster has 1
extent allocated and only 1 row on the pages in this extent. Thus, if you
have too many clusters (which could be made worse with the partitioning
since each partition has its own, independent clusters), you will see a lot
of disk space being needed.
DDL statement for my test is

CREATE TABLESPACE TSMDC
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsm dc' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

CREATE TABLESPACE TSMDCPART
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsm dcpart' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

CREATE TABLESPACE TSMDCPARTCOMP
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsm dcpartcomp' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

CREATE TABLE VIPER.TAB_MDC
(NOD DECIMAL(3, 0),
ROAD DECIMAL(3, 0),
CARS DECIMAL(7, 0),
RPS DECIMAL(3, 0),
DATEMODIFY DATE
)
IN TSMDC
ORGANIZE BY DIMENSIONS (NOD,ROAD);

CREATE TABLE VIPER.TAB_MDC_P ART
(NOD DECIMAL(3, 0),
ROAD DECIMAL(3, 0),
CARS DECIMAL(7, 0),
RPS DECIMAL(3, 0),
DATEMODIFY DATE
)
IN TSMDCPART
PARTITION BY RANGE (DATEMODIFY)
(STARTING '2002-12-01' ENDING '2006-09-30' EVERY 1 MONTH)
ORGANIZE BY DIMENSIONS (NOD,ROAD);

CREATE TABLE VIPER.TAB_MDC_P ART_COMP
(NOD DECIMAL(3, 0),
ROAD DECIMAL(3, 0),
CARS DECIMAL(7, 0),
RPS DECIMAL(3, 0),
DATEMODIFY DATE
)
IN TSMDCPARTCOMP
PARTITION BY RANGE (DATEMODIFY)
(STARTING '2002-12-01' ENDING '2006-09-30' EVERY 1 MONTH)
ORGANIZE BY DIMENSIONS (NOD,ROAD)
COMPRESS YES;

Values cardinality is NOD = 6, ROAD = 38, RPS = 13 , CARS is
randomly
How did you measure the size of the tables?
I'm inspect the size of tablespace container for every table after load
and reorg (for compressed table VIPER.TAB_MDC_P ART_COMP)

Sep 18 '06 #8
mitek wrote:
>
Hi, Knut. Thanx for reply.
>Do you mean "database partitioning" or "table partitioning"? (But I don't
think this would make a difference here.)

This is non DPF, only table partitioning.
>What are your clustering columns and how many distinct tuples do you have on
those? Because: if you use a unique column (e.g. primary key) then each
row will go to its own cluster. And that implies that each cluster has 1
extent allocated and only 1 row on the pages in this extent. Thus, if you
have too many clusters (which could be made worse with the partitioning
since each partition has its own, independent clusters), you will see a lot
of disk space being needed.

DDL statement for my test is

CREATE TABLESPACE TSMDC
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsm dc' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

CREATE TABLESPACE TSMDCPART
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsm dcpart' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

CREATE TABLESPACE TSMDCPARTCOMP
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsm dcpartcomp' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

CREATE TABLE VIPER.TAB_MDC
(NOD DECIMAL(3, 0),
ROAD DECIMAL(3, 0),
CARS DECIMAL(7, 0),
RPS DECIMAL(3, 0),
DATEMODIFY DATE
)
IN TSMDC
ORGANIZE BY DIMENSIONS (NOD,ROAD);

CREATE TABLE VIPER.TAB_MDC_P ART
(NOD DECIMAL(3, 0),
ROAD DECIMAL(3, 0),
CARS DECIMAL(7, 0),
RPS DECIMAL(3, 0),
DATEMODIFY DATE
)
IN TSMDCPART
PARTITION BY RANGE (DATEMODIFY)
(STARTING '2002-12-01' ENDING '2006-09-30' EVERY 1 MONTH)
ORGANIZE BY DIMENSIONS (NOD,ROAD);

CREATE TABLE VIPER.TAB_MDC_P ART_COMP
(NOD DECIMAL(3, 0),
ROAD DECIMAL(3, 0),
CARS DECIMAL(7, 0),
RPS DECIMAL(3, 0),
DATEMODIFY DATE
)
IN TSMDCPARTCOMP
PARTITION BY RANGE (DATEMODIFY)
(STARTING '2002-12-01' ENDING '2006-09-30' EVERY 1 MONTH)
ORGANIZE BY DIMENSIONS (NOD,ROAD)
COMPRESS YES;

Values cardinality is NOD = 6, ROAD = 38, RPS = 13 , CARS is
randomly
>How did you measure the size of the tables?

I'm inspect the size of tablespace container for every table after load
and reorg (for compressed table VIPER.TAB_MDC_P ART_COMP)
Run this query:
SELECT MAX(numrows) mx, MIN(numrows) mn, AVG(numrows) av
FROM
(SELECT month, COUNT(1) as numrows
FROM TAB_MDC_PART_CO MP
GROUP BY month, nod, road) AS T

If I recall correctly DB2 9 got a some extra fields in SYSCAt.TABLES or
SYSSTAT.TABLES which expose the average row length.
That can be used to compute the average number of extends per MDC cluster.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Sep 18 '06 #9

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

Similar topics

56
4967
by: Ashish Patankar | last post by:
I want to migrate my Oracle 10g database to Db2. I want some documentation for the comparision between these to databases. I also want to know which features of Oracle 10g are supported by Db2 and which are not supported.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9967
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4070
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.