UltraLite page_size creation parameter

Defines the database page size.

Syntax
{ ulcreate | ulinit | ulload } -o page_size=size[ k ];...
Allowed values

1k, 2k, 4k, 8k, 16k

Default

4k

Remarks

UltraLite databases are stored in pages, and all I/O operations are carried out a page at a time. The page size you choose can affect the performance or size of the database.

If you use any value other than those listed, the size is changed to the next larger size. If you do not specify a unit, bytes are assumed.

If your platform has limited dynamic memory, consider using a smaller page size to limit the effect on synchronization memory requirements.

When choosing a page size, you should keep the following guidelines in mind:

  • Database size   Larger databases usually benefit from a larger page size. Larger pages hold more information and therefore use space more effectively—particularly if you insert rows that are slightly more than half a page in size. The larger the page, the less page swapping that is required.

  • Number of rows   Because a row (excluding BLOBs) must fit on a page, the page size determines how large the largest packed row can be, and how many rows you can store on each page. In some cases, reading one page to obtain the values of one row may have the side effect of loading the contents of the next few rows into memory. See Row packing and table definitions.

  • Query types   In general, smaller page sizes are likely to benefit queries that retrieve a relatively small number of rows from random locations. By contrast, larger pages tend to benefit queries that perform sequential table scans.

  • Cache size   Large page sizes may require larger cache sizes. When your cache cannot hold enough pages, performance suffers as UltraLite begins swapping frequently-used pages to disk. See UltraLite CACHE_SIZE connection parameter.

  • Index entries   Page size also affects indexes. The larger the database page, the more index entries it can hold. See Working with UltraLite indexes.

  • Device memory   Small pages are particularly useful if your database must run on small devices with limited memory. For example, 1 MB of memory can hold 1000 pages that are each 1 KB in size, but only 250 pages that are 4 KB in size.

You cannot change the page size of an existing database. Instead, you must create a new database.

From Sybase Central, you can set the page size in any wizard that creates a database. On the New Database Storage Settings page, select the appropriate byte value.

From a client application, set this parameter as one of the creation parameters for the create database method on the database manager class.

See also
Example

To set the page size of the database to 8 KB, specify page_size=8k or page_size=8192:

ulcreate test.udb -o page_size=8k