If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > segmented vs simple tablespaces in do2 for z/os

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-05-05, 17:55
ricka49 ricka49 is offline
Registered User
 
Join Date: May 2002
Posts: 95
segmented vs simple tablespaces in db2 for z/os

in db2 for z/os segmented tables recover space from dropped tables and mass deletes. during day to day processing do they recover space when a page becomes empty??

we have segmented tablespaces with only one table so the dropped tables does not apply. is there any other advantage to a segmented tablespace with only one table??

Last edited by ricka49; 03-05-05 at 18:10.
Reply With Quote
  #2 (permalink)  
Old 03-05-05, 19:11
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Segmented tablespaces have a space map at the beginning of each segment. In some situations this can help DB2 more quickly find empty space during inserts, but the space map must be maintained by DB2. But in certain cases, inserting into segmented tablespaces can cause hot spots at the end of each segment.

IMO, segmented tablespaces are way over-sold if there is only one table in the tablespace. However, for DBA's that don't properly define PCTFREE and don't reorg the tablespaces when needed, segmented tablespaces are probably a good idea.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #3 (permalink)  
Old 03-06-05, 21:19
jacampbell jacampbell is offline
Registered User
 
Join Date: Jan 2005
Posts: 191
Some other advantages of segmented tablespaces:

- if you have rows of varying length (eg compressed), the greater detail about how much free space is available on each page means that DB2 can find pages with enough free space for a short row when there isn't enough for the longest possible row.

- mass deletes (delete without a where clause) are done by updating the free space pages, not each page

The free space pages occur rather less frequently than each segment - although more frequently than for simple tablespaces.

Not sure what you mean by "recover space". If you mean "make the space occupied by the deleted row available for other rows", the answer is "yes" for both simple and segmented tablespaces. The difference is that in a multi-table segmented tablespace all rows in the segment must be deleted before the segment is available to store rows from a different table.

James Campbell
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On