Doc
PRAGMA temp_store; PRAGMA temp_store = 0 | DEFAULT | 1 | FILE | 2 | MEMORY;
Query or change the setting of the “temp_store” parameter.
DEFAULT
When temp_store is DEFAULT (0), the compile-time C preprocessor macro SQLITE_TEMP_STORE is used to determine where temporary tables and indices are stored.
MEMORY
When temp_store is MEMORY (2) temporary tables and indices are kept in as if they were pure in-memory databases memory.
FILE
The temp_store_directory pragma can be used to specify the directory containing temporary files when FILE is specified. When the temp_store setting is changed, all existing temporary tables, indices, triggers, and views are immediately deleted.