1.Dd December 19, 2018 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_CACHE_SPILL , 18.Nm SQLITE_DBSTATUS_MAX 19.Nd Status Parameters for database connections 20.Sh SYNOPSIS 21.Fd #define SQLITE_DBSTATUS_LOOKASIDE_USED 22.Fd #define SQLITE_DBSTATUS_CACHE_USED 23.Fd #define SQLITE_DBSTATUS_SCHEMA_USED 24.Fd #define SQLITE_DBSTATUS_STMT_USED 25.Fd #define SQLITE_DBSTATUS_LOOKASIDE_HIT 26.Fd #define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 27.Fd #define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 28.Fd #define SQLITE_DBSTATUS_CACHE_HIT 29.Fd #define SQLITE_DBSTATUS_CACHE_MISS 30.Fd #define SQLITE_DBSTATUS_CACHE_WRITE 31.Fd #define SQLITE_DBSTATUS_DEFERRED_FKS 32.Fd #define SQLITE_DBSTATUS_CACHE_USED_SHARED 33.Fd #define SQLITE_DBSTATUS_CACHE_SPILL 34.Fd #define SQLITE_DBSTATUS_MAX 35.Sh DESCRIPTION 36These constants are the available integer "verbs" that can be passed 37as the second argument to the sqlite3_db_status() 38interface. 39.Pp 40New verbs may be added in future releases of SQLite. 41Existing verbs might be discontinued. 42Applications should check the return code from sqlite3_db_status() 43to make sure that the call worked. 44The sqlite3_db_status() interface will return a 45non-zero error code if a discontinued or unsupported verb is invoked. 46.Bl -tag -width Ds 47.It SQLITE_DBSTATUS_LOOKASIDE_USED 48This parameter returns the number of lookaside memory slots currently 49checked out. 50.It SQLITE_DBSTATUS_LOOKASIDE_HIT 51This parameter returns the number malloc attempts that were satisfied 52using lookaside memory. 53Only the high-water value is meaningful; the current value is always 54zero. 55.It SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE 56This parameter returns the number malloc attempts that might have been 57satisfied using lookaside memory but failed due to the amount of memory 58requested being larger than the lookaside slot size. 59Only the high-water value is meaningful; the current value is always 60zero. 61.It SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL 62This parameter returns the number malloc attempts that might have been 63satisfied using lookaside memory but failed due to all lookaside memory 64already being in use. 65Only the high-water value is meaningful; the current value is always 66zero. 67.It SQLITE_DBSTATUS_CACHE_USED 68This parameter returns the approximate number of bytes of heap memory 69used by all pager caches associated with the database connection. 70The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 710. 72.It SQLITE_DBSTATUS_CACHE_USED_SHARED 73This parameter is similar to DBSTATUS_CACHE_USED, except that if a 74pager cache is shared between two or more connections the bytes of 75heap memory used by that pager cache is divided evenly between the 76attached connections. 77In other words, if none of the pager caches associated with the database 78connection are shared, this request returns the same value as DBSTATUS_CACHE_USED. 79Or, if one or more or the pager caches are shared, the value returned 80by this call will be smaller than that returned by DBSTATUS_CACHE_USED. 81The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED_SHARED 82is always 0. 83.It SQLITE_DBSTATUS_SCHEMA_USED 84This parameter returns the approximate number of bytes of heap memory 85used to store the schema for all databases associated with the connection 86- main, temp, and any ATTACH-ed databases. 87The full amount of memory used by the schemas is reported, even if 88the schema memory is shared with other database connections due to 89shared cache mode being enabled. 90The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 910. 92.It SQLITE_DBSTATUS_STMT_USED 93This parameter returns the approximate number of bytes of heap and 94lookaside memory used by all prepared statements associated with the 95database connection. 96The highwater mark associated with SQLITE_DBSTATUS_STMT_USED is always 970. 98.It SQLITE_DBSTATUS_CACHE_HIT 99This parameter returns the number of pager cache hits that have occurred. 100The highwater mark associated with SQLITE_DBSTATUS_CACHE_HIT is always 1010. 102.It SQLITE_DBSTATUS_CACHE_MISS 103This parameter returns the number of pager cache misses that have occurred. 104The highwater mark associated with SQLITE_DBSTATUS_CACHE_MISS is always 1050. 106.It SQLITE_DBSTATUS_CACHE_WRITE 107This parameter returns the number of dirty cache entries that have 108been written to disk. 109Specifically, the number of pages written to the wal file in wal mode 110databases, or the number of pages written to the database file in rollback 111mode databases. 112Any pages written as part of transaction rollback or database recovery 113operations are not included. 114If an IO or other error occurs while writing a page to disk, the effect 115on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined. 116The highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 1170. 118.It SQLITE_DBSTATUS_CACHE_SPILL 119This parameter returns the number of dirty cache entries that have 120been written to disk in the middle of a transaction due to the page 121cache overflowing. 122Transactions are more efficient if they are written to disk all at 123once. 124When pages spill mid-transaction, that introduces additional overhead. 125This parameter can be used help identify inefficiencies that can be 126resolve by increasing the cache size. 127.It SQLITE_DBSTATUS_DEFERRED_FKS 128This parameter returns zero for the current value if and only if all 129foreign key constraints (deferred or immediate) have been resolved. 130The highwater mark is always 0. 131.El 132.Pp 133.Sh SEE ALSO 134.Xr sqlite3_db_status 3 135