1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Added PRAGMAs</title>
<link rel="stylesheet" href="gettingStarted.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" />
<link rel="up" href="dbsqlbasics.html" title="Chapter 1. Berkeley DB SQL: The Absolute Basics" />
<link rel="prev" href="changedpragmas.html" title="Changed PRAGMAs" />
<link rel="next" href="miscdiff.html" title="Miscellaneous Differences" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Added PRAGMAs</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="changedpragmas.html">Prev</a> </td>
<th width="60%" align="center">Chapter 1. Berkeley DB SQL: The Absolute Basics</th>
<td width="20%" align="right"> <a accesskey="n" href="miscdiff.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="addedpragmas"></a>Added PRAGMAs</h2>
</div>
</div>
</div>
<div class="toc">
<dl>
<dt>
<span class="sect2">
<a href="addedpragmas.html#pragma_txn_bulk">PRAGMA TXN_BULK</a>
</span>
</dt>
</dl>
</div>
<p>The following PRAGMAs are added in the Berkeley DB SQL interface.</p>
<div class="sect2" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a id="pragma_txn_bulk"></a>PRAGMA TXN_BULK</h3>
</div>
</div>
</div>
<p>
<span class="bold"><strong>PRAGMA TXN_BULK</strong></span> = 0 | 1;
</p>
<p>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:
</p>
<div class="itemizedlist">
<ul type="disc">
<li>transactional bulk loading optimization is enabled for
top-level transactions</li>
<li>nested per-statement transactions are not used</li>
</ul>
</div>
<p>
</p>
<p>
PRAGMA TXN_BULK enables two optimizations.
The transactional bulk loading optimization uses the
<a href="../api_reference/C/txnbegin.html#txnbegin_DB_TXN_BULK" class="olink">DB_TXN_BULK</a> flag
when starting transactions. Note that there are
implications of using the
<a href="../api_reference/C/txnbegin.html#txnbegin_DB_TXN_BULK" class="olink">DB_TXN_BULK</a> 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.
</p>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="changedpragmas.html">Prev</a> </td>
<td width="20%" align="center">
<a accesskey="u" href="dbsqlbasics.html">Up</a>
</td>
<td width="40%" align="right"> <a accesskey="n" href="miscdiff.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Changed PRAGMAs </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> Miscellaneous Differences</td>
</tr>
</table>
</div>
</body>
</html>
|