473,513 Members | 2,263 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MDC+partitioning+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
....RESETDICTIONARY)
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 3033
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\tsmdc' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

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

CREATE TABLESPACE TSMDCPARTCOMP
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsmdcpartcomp' 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_PART
(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_PART_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_PART_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\tsmdc' 10 M )
AUTORESIZE YES
INCREASESIZE 10 M
MAXSIZE NONE;

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

CREATE TABLESPACE TSMDCPARTCOMP
PAGESIZE 4K
MANAGED BY DATABASE
USING (FILE 'F:\VIPERDB\tsmdcpartcomp' 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_PART
(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_PART_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_PART_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_COMP
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
4888
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...
0
7265
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,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7114
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5693
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5098
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4751
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...
0
3230
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1607
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 ...
0
461
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...

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.