Library Version 18.1.40

DB->set_heap_regionsize()
Prev | Chapter 2. The DB Handle | Next

## DB->set_heap_regionsize()

    #include <db.h>

    int
    DB->set_heap_regionsize(DB *db, u_int32_t npages);

Sets the number of pages in a region of a database configured to use the Heap access method. If this method is never called, the default region size for the database's page size will be used. You can set the database page size using the DB->set_pagesize() method.

The `DB->set_heap_regionsize()` method may not be called after the DB->open() method is called. If the database already exists when DB->open() is called, the information specified to `DB->set_heap_regionsize()` will be ignored. If the specified region size is larger than the maximum region size for the database's page size, an error will be returned when DB->open() is called. The maximum allowable region size will be included in the error message.

The `DB->set_heap_regionsize()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### npages

The npages parameter is the number of pages in a Heap database region.

### Errors

The `DB->set_heap_regionsize()` method may fail and return one of the following non-zero errors:

#### EINVAL

If the specified region size was too small; the method was called after DB->open() was called; or if an invalid flag value or parameter was specified.

### Class

DB

### See Also

Database and Related Methods, DB->get_heap_regionsize()

Prev | Up | Next
DB->set_heapsize() | Home | DB->set_lk_exclusive()