Added PRAGMAs
Prev | Chapter 1. Berkeley DB SQL: The Absolute Basics | Next

## Added PRAGMAs

The following PRAGMAs are added in the Berkeley DB SQL interface.

### PRAGMA TXN_BULK

PRAGMA TXN_BULK = 0 | 1;

Enables transactional bulk loading optimization. The default setting for TXN_BULK is 0. This means the PRAGMA is turned off. When TXN_BULK is set to 1 in the SQL source, it causes the application to enter a mode in which:

- transactional bulk loading optimization is enabled for top-level transactions
- nested per-statement transactions are not used

PRAGMA TXN_BULK enables two optimizations. The transactional bulk loading optimization uses the DB_TXN_BULK flag when starting transactions. Note that there are implications of using the DB_TXN_BULK flag, particularly with regard to its interaction with hot backup. The other optimization omits nested subtransactions for each statement. When this optimization is enabled, you can not undo any single statement. If any statement must be undone, then the entire encompassing transaction must be aborted. This is a compromise, trading speed of bulk inserts against the standard statement undo guarantees. With these two optimizations, a transaction that inserts a large number of new records can run with much less I/O and transaction management overhead.

Prev | Up | Next
Changed PRAGMAs | Home | Miscellaneous Differences