Library Version 18.1.25

Slice APIs
Prev | Chapter 14. Berkeley DB Slice Support | Next

## Slice APIs

Most of the DB methods behave the same way with or without a sliced environment or database. Some small differences in behavior may result when using a sliced environment or database, and a few methods simply do not support slices. These differences are identified in the Berkeley DB C API Reference Guide when they occur.

In addition, sliced environments and databases offer the following methods:

- `DB_ENV->get_slice_count()`

  Returns the number of slices configured for the environment.

- `DB_ENV->get_slices()`

  Returns an array of pointers to sub-environments in use to support your sliced environment. Be aware that all these handles are automatically closed when you close the encompassing environment; you should not close them explicitly.

- `DB->set_slice_callback()`

  Sets an optional callback that is used to identify the slice-relevant portion of your records' key. It allows a transaction to access many different keys, as long as the slice callback for those keys returns the same value.

- `DB->get_slices()`

  Returns an array of pointers to databases in use to support your sliced environment. There is one such database for each slice that you configured for your environment. Be aware that all these handles are automatically closed when you close the top-level database handle; you should not close them explicitly.

- `DB->slice_lookup()`

  Returns the slice database which contains the key that you provide to this method.

Prev | Up | Next
Chapter 14. Berkeley DB Slice Support | Home | Key Design