xref: /netbsd-src/external/public-domain/sqlite/man/SQLITE_DBSTATUS_LOOKASIDE_USED.3 (revision bdc22b2e01993381dcefeff2bc9b56ca75a4235c)
1.Dd March 11, 2017
2.Dt SQLITE_DBSTATUS_LOOKASIDE_USED 3
3.Os
4.Sh NAME
5.Nm SQLITE_DBSTATUS_LOOKASIDE_USED ,
6.Nm SQLITE_DBSTATUS_CACHE_USED ,
7.Nm SQLITE_DBSTATUS_SCHEMA_USED ,
8.Nm SQLITE_DBSTATUS_STMT_USED ,
9.Nm SQLITE_DBSTATUS_LOOKASIDE_HIT ,
10.Nm SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE ,
11.Nm SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL ,
12.Nm SQLITE_DBSTATUS_CACHE_HIT ,
13.Nm SQLITE_DBSTATUS_CACHE_MISS ,
14.Nm SQLITE_DBSTATUS_CACHE_WRITE ,
15.Nm SQLITE_DBSTATUS_DEFERRED_FKS ,
16.Nm SQLITE_DBSTATUS_CACHE_USED_SHARED ,
17.Nm SQLITE_DBSTATUS_MAX
18.Nd Status Parameters for database connections
19.Sh SYNOPSIS
20.Fd #define SQLITE_DBSTATUS_LOOKASIDE_USED
21.Fd #define SQLITE_DBSTATUS_CACHE_USED
22.Fd #define SQLITE_DBSTATUS_SCHEMA_USED
23.Fd #define SQLITE_DBSTATUS_STMT_USED
24.Fd #define SQLITE_DBSTATUS_LOOKASIDE_HIT
25.Fd #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
26.Fd #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
27.Fd #define SQLITE_DBSTATUS_CACHE_HIT
28.Fd #define SQLITE_DBSTATUS_CACHE_MISS
29.Fd #define SQLITE_DBSTATUS_CACHE_WRITE
30.Fd #define SQLITE_DBSTATUS_DEFERRED_FKS
31.Fd #define SQLITE_DBSTATUS_CACHE_USED_SHARED
32.Fd #define SQLITE_DBSTATUS_MAX
33.Sh DESCRIPTION
34These constants are the available integer "verbs" that can be passed
35as the second argument to the sqlite3_db_status()
36interface.
37.Pp
38New verbs may be added in future releases of SQLite.
39Existing verbs might be discontinued.
40Applications should check the return code from sqlite3_db_status()
41to make sure that the call worked.
42The sqlite3_db_status() interface will return a
43non-zero error code if a discontinued or unsupported verb is invoked.
44.Bl -tag -width Ds
45.It SQLITE_DBSTATUS_LOOKASIDE_USED
46This parameter returns the number of lookaside memory slots currently
47checked out.
48.It SQLITE_DBSTATUS_LOOKASIDE_HIT
49This parameter returns the number malloc attempts that were satisfied
50using lookaside memory.
51Only the high-water value is meaningful; the current value is always
52zero.
53.It SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
54This parameter returns the number malloc attempts that might have been
55satisfied using lookaside memory but failed due to the amount of memory
56requested being larger than the lookaside slot size.
57Only the high-water value is meaningful; the current value is always
58zero.
59.It SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
60This parameter returns the number malloc attempts that might have been
61satisfied using lookaside memory but failed due to all lookaside memory
62already being in use.
63Only the high-water value is meaningful; the current value is always
64zero.
65.It SQLITE_DBSTATUS_CACHE_USED
66This parameter returns the approximate number of bytes of heap memory
67used by all pager caches associated with the database connection.
68The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always
690.
70.It SQLITE_DBSTATUS_CACHE_USED_SHARED
71This parameter is similar to DBSTATUS_CACHE_USED, except that if a
72pager cache is shared between two or more connections the bytes of
73heap memory used by that pager cache is divided evenly between the
74attached connections.
75In other words, if none of the pager caches associated with the database
76connection are shared, this request returns the same value as DBSTATUS_CACHE_USED.
77Or, if one or more or the pager caches are shared, the value returned
78by this call will be smaller than that returned by DBSTATUS_CACHE_USED.
79The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED_SHARED
80is always 0.
81.It SQLITE_DBSTATUS_SCHEMA_USED
82This parameter returns the approximate number of bytes of heap memory
83used to store the schema for all databases associated with the connection
84- main, temp, and any ATTACH-ed databases.
85The full amount of memory used by the schemas is reported, even if
86the schema memory is shared with other database connections due to
87shared cache mode being enabled.
88The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always
890.
90.It SQLITE_DBSTATUS_STMT_USED
91This parameter returns the approximate number of bytes of heap and
92lookaside memory used by all prepared statements associated with the
93database connection.
94The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always
950.
96.It SQLITE_DBSTATUS_CACHE_HIT
97This parameter returns the number of pager cache hits that have occurred.
98The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT is always
990.
100.It SQLITE_DBSTATUS_CACHE_MISS
101This parameter returns the number of pager cache misses that have occurred.
102The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS is always
1030.
104.It SQLITE_DBSTATUS_CACHE_WRITE
105This parameter returns the number of dirty cache entries that have
106been written to disk.
107Specifically, the number of pages written to the wal file in wal mode
108databases, or the number of pages written to the database file in rollback
109mode databases.
110Any pages written as part of transaction rollback or database recovery
111operations are not included.
112If an IO or other error occurs while writing a page to disk, the effect
113on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.
114The highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always
1150.
116.It SQLITE_DBSTATUS_DEFERRED_FKS
117This parameter returns zero for the current value if and only if all
118foreign key constraints (deferred or immediate) have been resolved.
119The highwater mark is always 0.
120.El
121.Pp
122.Sh SEE ALSO
123.Xr sqlite3_db_status 3
124