Extents

Adaptive Server pages are always allocated to a table, index, or LOB structure. A block of 8 pages is called an extent. The size of an extent depends on the page size the server uses. The extent size on a 2K server is 16K; on an 8K it is 64K, and so on. The smallest amount of space that a table or index can occupy is 1 extent, or 8 pages. Extents are deallocated only when all the pages in an extent are empty.

The use of extents in Adaptive Server is transparent to the user except when examining reports on space usage. For example, reports from sp_spaceused display the space allocated (the reserved column) and the space used by data and indexes. The unused column displays the amount of space in extents that are allocated to an object, but not yet used to store data.

sp_spaceused titles
name   rowtotal reserved data    index_size unused
------ -------- -------- ------- ---------- ------ 
titles 5000     1392 KB 1250 KB 94 KB      48 KB

In this report, the titles table and its indexes have 1392KB reserved on various extents, including 48KB (24 data pages) that is unallocated.

NoteAdaptive Server avoids wasting extra space by filling up existing allocated extents in the target allocation page, even though these extents are assigned to other partitions. The net effect is that extents are allocated only when there are no free extents in the target allocation page