Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 17 » UltraLite - Database Management and Developer Guide » UltraLite database reference » UltraLite options

UltraLite page_size creation option

Specify the database page size in kilobytes.

Syntax
page_size=sizeK
Allowed values

1K, 2K, 4K, 8K, 16K

Default

4K

Remarks

The page size must be entered with a K or k after the digit, or, alternatively, the equivalent number of bytes (1024, 2048, 4096, 8192, or 16384).

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. Sometimes 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.

  • 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. With dynamic cache sizing, UltraLite grows the cache as required.

  • Index entries

    Page size also affects indexes. The larger the database page, the more index entries it can hold.

  • 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 SQL Central, you can set the page size in any wizard that creates a database. On the New database storage settings page of the Create Database Wizard, click the desired page size.

From a client application, set this option as one of the creation options for the CreateDatabase method on the DatabaseManager/ULDatabaseManager class.

Example

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

ulinit test.udb --page_size=8k