1、- 1 - 外文原文 Database Configuration SQLite doesnt have a configuration file. Rather, all of its configuration parameters are implemented using pragmas. Pragmas work in different ways. Some are like variables; others are like commands. They cover many aspects of the database, such as runtime informatio
2、n, database schema, versioning, file format, memory use, and debugging. Some pragmas are read and set like variables, while others require arguments and are called like functions. Many pragmas have both temporary and permanent forms. Temporary forms affect only the current session for the duration o
3、f its lifetime. The permanent forms are stored in the database and affect every session. The cache size is one such example. This section covers the most commonly used pragmas. A complete list of all SQLite pragmas can be found in Appendix A. The Connection Cache Size The cache size pragmas control
4、how many database pages a session can hold in memory. To set the default cache size for the current session, you use the cache_size pragma: sqlite PRAGMA cache_size; cache_size - 2000 sqlite PRAGMA cache_size=10000; sqlite PRAGMA cache_size; cache_size - 10000 You can permanently set the cache size for all sessions using the default_cache_size pragma. This setting is stored in the database. This will only take effect for sessions created after the change, not for cur