Debian Codegraph @

www/c3ref/c_dbstatus_options.html

raw
1 <!DOCTYPE html>
2 <html><head>
3 <meta name="viewport" content="width=device-width, initial-scale=1.0">
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
5 <link href="../sqlite.css" rel="stylesheet">
6 <title>Status Parameters for database connections</title>
7 <!-- path=../ -->
8 </head>
9 <body>
10 <div class=nosearch>
11 <a href="../index.html">
12 <img class="logo" src="../images/sqlite370_banner.gif" alt="SQLite" border="0">
13 </a>
14 <div><!-- IE hack to prevent disappearing logo --></div>
15 <div class="tagline desktoponly">
16 Small. Fast. Reliable.<br>Choose any three.
17 </div>
18 <div class="menu mainmenu">
19 <ul>
20 <li><a href="../index.html">Home</a>
21 <li class='mobileonly'><a href="javascript:void(0)" onclick='toggle_div("submenu")'>Menu</a>
22 <li class='wideonly'><a href='../about.html'>About</a>
23 <li class='desktoponly'><a href="../docs.html">Documentation</a>
24 <li class='desktoponly'><a href="../download.html">Download</a>
25 <li class='wideonly'><a href='../copyright.html'>License</a>
26 <li class='desktoponly'><a href="../support.html">Support</a>
27 <li class='desktoponly'><a href="../prosupport.html">Purchase</a>
28 <li class='search' id='search_menubutton'>
29 <a href="javascript:void(0)" onclick='toggle_search()'>Search</a>
30 </ul>
31 </div>
32 <div class="menu submenu" id="submenu">
33 <ul>
34 <li><a href='../about.html'>About</a>
35 <li><a href='../docs.html'>Documentation</a>
36 <li><a href='../download.html'>Download</a>
37 <li><a href='../support.html'>Support</a>
38 <li><a href='../prosupport.html'>Purchase</a>
39 </ul>
40 </div>
41 <div class="searchmenu" id="searchmenu">
42 <form method="GET" action="../search">
43 <select name="s" id="searchtype">
44 <option value="d">Search Documentation</option>
45 <option value="c">Search Changelog</option>
46 </select>
47 <input type="text" name="q" id="searchbox" value="">
48 <input type="submit" value="Go">
49 </form>
50 </div>
51 </div>
52 <script>
53 function toggle_div(nm) {
54 var w = document.getElementById(nm);
55 if( w.style.display=="block" ){
56 w.style.display = "none";
57 }else{
58 w.style.display = "block";
59 }
60 }
61 function toggle_search() {
62 var w = document.getElementById("searchmenu");
63 if( w.style.display=="block" ){
64 w.style.display = "none";
65 } else {
66 w.style.display = "block";
67 setTimeout(function(){
68 document.getElementById("searchbox").focus()
69 }, 30);
70 }
71 }
72 function div_off(nm){document.getElementById(nm).style.display="none";}
73 window.onbeforeunload = function(e){div_off("submenu");}
74 /* Disable the Search feature if we are not operating from CGI, since */
75 /* Search is accomplished using CGI and will not work without it. */
76 if( !location.origin || !location.origin.match || !location.origin.match(/http/) ){
77 document.getElementById("search_menubutton").style.display = "none";
78 }
79 /* Used by the Hide/Show button beside syntax diagrams, to toggle the */
80 function hideorshow(btn,obj){
81 var x = document.getElementById(obj);
82 var b = document.getElementById(btn);
83 if( x.style.display!='none' ){
84 x.style.display = 'none';
85 b.innerHTML='show';
86 }else{
87 x.style.display = '';
88 b.innerHTML='hide';
89 }
90 return false;
91 }
92 var antiRobot = 0;
93 function antiRobotGo(){
94 if( antiRobot!=3 ) return;
95 antiRobot = 7;
96 var j = document.getElementById("mtimelink");
97 if(j && j.hasAttribute("data-href")) j.href=j.getAttribute("data-href");
98 }
99 function antiRobotDefense(){
100 document.body.onmousedown=function(){
101 antiRobot |= 2;
102 antiRobotGo();
103 document.body.onmousedown=null;
104 }
105 document.body.onmousemove=function(){
106 antiRobot |= 2;
107 antiRobotGo();
108 document.body.onmousemove=null;
109 }
110 setTimeout(function(){
111 antiRobot |= 1;
112 antiRobotGo();
113 }, 100)
114 antiRobotGo();
115 }
116 antiRobotDefense();
117 </script>
118 <!-- keywords: {SQLITE_DBSTATUS options} SQLITE_DBSTATUS_CACHE_HIT SQLITE_DBSTATUS_CACHE_MISS SQLITE_DBSTATUS_CACHE_SPILL SQLITE_DBSTATUS_CACHE_USED SQLITE_DBSTATUS_CACHE_USED_SHARED SQLITE_DBSTATUS_CACHE_WRITE SQLITE_DBSTATUS_DEFERRED_FKS SQLITE_DBSTATUS_LOOKASIDE_HIT SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE SQLITE_DBSTATUS_LOOKASIDE_USED SQLITE_DBSTATUS_MAX SQLITE_DBSTATUS_SCHEMA_USED SQLITE_DBSTATUS_STMT_USED -->
119 <div class=nosearch>
120 <a href="../c3ref/intro.html"><h2>SQLite C Interface</h2></a>
121 <h2>Status Parameters for database connections</h2>
122 </div>
123 <blockquote><pre>
124 #define SQLITE_DBSTATUS_LOOKASIDE_USED 0
125 #define SQLITE_DBSTATUS_CACHE_USED 1
126 #define SQLITE_DBSTATUS_SCHEMA_USED 2
127 #define SQLITE_DBSTATUS_STMT_USED 3
128 #define SQLITE_DBSTATUS_LOOKASIDE_HIT 4
129 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 5
130 #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 6
131 #define SQLITE_DBSTATUS_CACHE_HIT 7
132 #define SQLITE_DBSTATUS_CACHE_MISS 8
133 #define SQLITE_DBSTATUS_CACHE_WRITE 9
134 #define SQLITE_DBSTATUS_DEFERRED_FKS 10
135 #define SQLITE_DBSTATUS_CACHE_USED_SHARED 11
136 #define SQLITE_DBSTATUS_CACHE_SPILL 12
137 #define SQLITE_DBSTATUS_MAX 12 /* Largest defined DBSTATUS */
138 </pre></blockquote>
139 <p>
140 These constants are the available integer "verbs" that can be passed as
141 the second argument to the <a href="../c3ref/db_status.html">sqlite3_db_status()</a> interface.</p>
142
143 <p>New verbs may be added in future releases of SQLite. Existing verbs
144 might be discontinued. Applications should check the return code from
145 <a href="../c3ref/db_status.html">sqlite3_db_status()</a> to make sure that the call worked.
146 The <a href="../c3ref/db_status.html">sqlite3_db_status()</a> interface will return a non-zero error code
147 if a discontinued or unsupported verb is invoked.</p>
148
149 <p><dl>
150 <a name="sqlitedbstatuslookasideused"></a>
151 <dt>SQLITE_DBSTATUS_LOOKASIDE_USED</dt>
152 <dd>This parameter returns the number of lookaside memory slots currently
153 checked out.</dd></p>
154
155 <p><a name="sqlitedbstatuslookasidehit"></a>
156 <dt>SQLITE_DBSTATUS_LOOKASIDE_HIT</dt>
157 <dd>This parameter returns the number of malloc attempts that were
158 satisfied using lookaside memory. Only the high-water value is meaningful;
159 the current value is always zero.</p>
160
161 <p><a name="sqlitedbstatuslookasidemisssize"></a>
162
163 <dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE</dt>
164 <dd>This parameter returns the number malloc attempts that might have
165 been satisfied using lookaside memory but failed due to the amount of
166 memory requested being larger than the lookaside slot size.
167 Only the high-water value is meaningful;
168 the current value is always zero.</p>
169
170 <p><a name="sqlitedbstatuslookasidemissfull"></a>
171
172 <dt>SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL</dt>
173 <dd>This parameter returns the number malloc attempts that might have
174 been satisfied using lookaside memory but failed due to all lookaside
175 memory already being in use.
176 Only the high-water value is meaningful;
177 the current value is always zero.</p>
178
179 <p><a name="sqlitedbstatuscacheused"></a>
180 <dt>SQLITE_DBSTATUS_CACHE_USED</dt>
181 <dd>This parameter returns the approximate number of bytes of heap
182 memory used by all pager caches associated with the database connection.
183 The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.</p>
184
185 <p><a name="sqlitedbstatuscacheusedshared"></a>
186
187 <dt>SQLITE_DBSTATUS_CACHE_USED_SHARED</dt>
188 <dd>This parameter is similar to DBSTATUS_CACHE_USED, except that if a
189 pager cache is shared between two or more connections the bytes of heap
190 memory used by that pager cache is divided evenly between the attached
191 connections. In other words, if none of the pager caches associated
192 with the database connection are shared, this request returns the same
193 value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are
194 shared, the value returned by this call will be smaller than that returned
195 by DBSTATUS_CACHE_USED. The highwater mark associated with
196 SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0.</p>
197
198 <p><a name="sqlitedbstatusschemaused"></a>
199 <dt>SQLITE_DBSTATUS_SCHEMA_USED</dt>
200 <dd>This parameter returns the approximate number of bytes of heap
201 memory used to store the schema for all databases associated
202 with the connection - main, temp, and any <a href="../lang_attach.html">ATTACH</a>-ed databases.
203 The full amount of memory used by the schemas is reported, even if the
204 schema memory is shared with other database connections due to
205 <a href="../sharedcache.html">shared cache mode</a> being enabled.
206 The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0.</p>
207
208 <p><a name="sqlitedbstatusstmtused"></a>
209 <dt>SQLITE_DBSTATUS_STMT_USED</dt>
210 <dd>This parameter returns the approximate number of bytes of heap
211 and lookaside memory used by all prepared statements associated with
212 the database connection.
213 The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 0.
214 </dd></p>
215
216 <p><a name="sqlitedbstatuscachehit"></a>
217 <dt>SQLITE_DBSTATUS_CACHE_HIT</dt>
218 <dd>This parameter returns the number of pager cache hits that have
219 occurred. The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT
220 is always 0.
221 </dd></p>
222
223 <p><a name="sqlitedbstatuscachemiss"></a>
224 <dt>SQLITE_DBSTATUS_CACHE_MISS</dt>
225 <dd>This parameter returns the number of pager cache misses that have
226 occurred. The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS
227 is always 0.
228 </dd></p>
229
230 <p><a name="sqlitedbstatuscachewrite"></a>
231 <dt>SQLITE_DBSTATUS_CACHE_WRITE</dt>
232 <dd>This parameter returns the number of dirty cache entries that have
233 been written to disk. Specifically, the number of pages written to the
234 wal file in wal mode databases, or the number of pages written to the
235 database file in rollback mode databases. Any pages written as part of
236 transaction rollback or database recovery operations are not included.
237 If an IO or other error occurs while writing a page to disk, the effect
238 on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined. The
239 highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.
240 </dd></p>
241
242 <p><a name="sqlitedbstatuscachespill"></a>
243 <dt>SQLITE_DBSTATUS_CACHE_SPILL</dt>
244 <dd>This parameter returns the number of dirty cache entries that have
245 been written to disk in the middle of a transaction due to the page
246 cache overflowing. Transactions are more efficient if they are written
247 to disk all at once. When pages spill mid-transaction, that introduces
248 additional overhead. This parameter can be used help identify
249 inefficiencies that can be resolved by increasing the cache size.
250 </dd></p>
251
252 <p><a name="sqlitedbstatusdeferredfks"></a>
253 <dt>SQLITE_DBSTATUS_DEFERRED_FKS</dt>
254 <dd>This parameter returns zero for the current value if and only if
255 all foreign key constraints (deferred or immediate) have been
256 resolved. The highwater mark is always 0.
257 </dd>
258 </dl>
259 </p><p>See also lists of
260 <a href="../c3ref/objlist.html">Objects</a>,
261 <a href="../c3ref/constlist.html">Constants</a>, and
262 <a href="../c3ref/funclist.html">Functions</a>.</p>
263