DB2 z/os compression question:

charles cabrera

DB2 z/os compression question:

At the client I am currently at, they went a little overboard in compressing all tables.  Slowly removing compression where it doesn't make sense.  Hoping someone can share some light on what I'm seeing.  We have a table with 22 rows with Maxrows set to 1 (to get 1 row per page).   Compressed the tablespace has 130 pages, uncompressed it is 25 pages.  I can understand the 25 pages when uncompressed (22 for data, 1 space map page, 1 header page and 1 freepage --> freepage is set to 15).  Wondering why so many pages (130) when it is compressed?  I thought the dictionary is to 64KB (16 pages), expect total pages to be 41 not 130. 

The table has 2 columns: char(8) & dec(10) with 22 rows. Tablespase has Segsize 64, Freepage 15, Pctfree 10,  Maxrows 1, pagesize is 4K.   Rows are never inserted nor deleted, only updated.     

Thanks Charlie

Colin Clayton

DB2 z/OS compression question:
(in response to charles cabrera)
You could DSN1PRNT it to see what’s in each page…


From: charles cabrera [mailto:[login to unmask email]
Sent: 22 February 2018 17:04
To: [login to unmask email]
Subject: [DB2-L] - DB2 z/os compression question:


At the client I am currently at, they went a little overboard in compressing all tables. Slowly removing compression where it doesn't make sense. Hoping someone can share some light on what I'm seeing. We have a table with 22 rows with Maxrows set to 1 (to get 1 row per page). Compressed the tablespace has 130 pages, uncompressed it is 25 pages. I can understand the 25 pages when uncompressed (22 for data, 1 space map page, 1 header page and 1 freepage --> freepage is set to 15). Wondering why so many pages (130) when it is compressed? I thought the dictionary is to 64KB (16 pages), expect total pages to be 41 not 130.

The table has 2 columns: char(8) & dec(10) with 22 rows. Tablespase has Segsize 64, Freepage 15, Pctfree 10, Maxrows 1, pagesize is 4K. Rows are never inserted nor deleted, only updated.

Thanks Charlie

-----End Original Message-----

charles cabrera

RE: DB2 z/OS compression question:
(in response to Colin Clayton)

Good thought, I can run DSN1PRNT.  Thought about it some more and wonder if DB2 allocates a segment (64 pgs in this case) for the dictionary even if it only uses 16 pgs.  Then 1 segment for the dictionary (64 pgs), 1 segment for the data (another 64 pgs), add in the spacemap and header pages and it totals to the 130 pages.