This section covers the following topics:
An extent is a collection of contiguous pages within a chunk. Every permanent database table has two extent sizes associated with it. The initial-extent size is the number of kilobytes allocated to the table when it is first created. The next-extent size is the number of kilobytes allocated to the table when the initial extent, and every extent thereafter, becomes full.
For specific instructions on how to specify and calculate the size of an extent, see your IBM Informix: Performance Guide.
The minimum size of an extent is four pages. The default size of an extent is eight pages. The maximum size of an extent is 16777215 pages. If the extent is created in a chunk that has fewer than 16777215 contiguous free pages, the maximum extent size depends on the contiguous space available in the chunk.
Tblspaces that hold index fragments follow different rules for extent size. The database server bases the extent size for these tblspaces on the extent size for the corresponding table fragment. The database server uses the ratio of the row size to index key size to assign an appropriate extent size for the index tblspace (see the section on estimating index page size in the IBM Informix: Performance Guide). For more information, see fragmenting table indexes in the chapter on table fragmentation and PDQ in the IBM Informix: Administrator's Guide.
Within the extent, individual pages contain different types of data. Extent pages for a table can be separated into the following categories:
Data pages contain the data rows for the table.
Bit-map pages contain control information that monitors the fullness of every page in the extent.
Free pages are pages in the extent that are allocated for tblspace use, but whose function has not yet been defined. Free pages can be used to store any kind of information: data, including TEXT or BYTE data types; index; or bit map.
Figure 9 illustrates the possible structure of a nonfragmented table with an initial-extent size of 8 pages and a next-extent size of 16 pages.
The database server stores index pages in different tblspaces than the table with which it is associated. Within the extent, individual index pages contain different types of data. Index pages can be separated into the following categories:
Index pages contain the index information for the table.
Bit-map pages contain control information that monitors the fullness of every page in the extent.
Free pages are pages in the extent that are allocated for tblspace use, but whose function has not yet been defined. Free pages can be used to store any kind of information: data, index, TEXT or BYTE data, or bit map.
All indexes in IBM Informix Extended Parallel Server are detached unless you explicitly specify attached indexes.
Figure 10 illustrates the extent structure of an index.
After the initial extent fills, the database server attempts to allocate another extent of contiguous disk space. The procedure that the database server follows is referred to as next-extent allocation.
Extents for a tblspace are tracked as one component of the tblspace tblspace information for the table. The maximum number of extents allocated for any tblspace is application and machine dependent because it varies with the amount of space available on the tblspace tblspace entry.
The number of kilobytes that the database server allocates for a next extent is, in general, equal to the size of a next extent, as specified in the SQL statement CREATE TABLE. However, the actual size of the next-extent allocation might deviate from the specified size because the allocation procedure takes into account the following three factors:
The effect of each of these factors on next-extent allocation is explained in the paragraphs that follow and in Figure 11.
If a tblspace already has 16 extents allocated, the database server automatically doubles the size for subsequent allocations. This doubling occurs every 16 extents. For example, if you create a table with NEXT SIZE equal to 20 kilobytes, the database server allocates the first 16 extents at a size of 20 kilobytes each. The database server allocates extents 17 to 32 at 40 kilobytes each, extents 33 to 48 at 80 kilobytes each, and so on.
If the database server cannot find available contiguous space in the first chunk equal to the size specified for the next extent, it extends the search to the next chunk in the dbspace. Extents are not allowed to span chunks.
If the database server cannot find adequate contiguous space anywhere in the dbspace, it allocates to the table the largest available amount of contiguous space. (The minimum allocation is four pages. The default value is eight pages.) No error message is returned if an allocation is possible, even when the amount of space allocated is less than the requested amount.
If the disk space allocated for a next extent is physically contiguous with disk space already allocated to the same table, the database server allocates the disk space but does not consider the new allocation as a separate extent. Instead, the database server extends the size of the existing contiguous extent. Thereafter, all disk-space reports reflect the allocation as an extension of the existing extent. That is, the number of extents reported is always the number of physically distinct extents, not the number of times a next extent has been allocated plus one (the initial extent). Figure 11 illustrates extent-allocation strategies.
After disk space is allocated to a tblspace as part of an extent, the space remains dedicated to that tblspace even if the data contained in it is deleted. For alternative methods of reclaiming this empty disk space, see your IBM Informix: Performance Guide.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]