On Jun 30, 2008, at 4:48 PM, Shawn Wilsher wrote: > Hey all, > > Over at mozilla we are looking into using more temporary tables, and > likely want them all to be in memory as opposed to files. I was > looking at http://sqlite.org/pragma.html#pragma_temp_store, and > noticed the table, which seems to imply that if TEMP_STORE is either > zero or not defined, temporary tables are always written to a file. > Is this correct, or is the documentation a bit misleading? >
The default TEMP_STORE is 1, not 0. The default "PRAGMA temp_store" is 0. TEMP_STORE=1 means that temporary storage defaults to a file but can be overridden by the temp_store pragma. Temporary storage is never fsync-ed. For that matter, temporary files are always delete-on-close. So in an OS with a good disk cache, little or no real disk I/O ever actually occurs on temp files. Instead, all the data just gets moved in and out of cache blocks in the kernel. This normally works better than storing the temp data in memory since after the temp data is deleted, the disk cache block can be reused by other processes. A draft of the upcoming version 3.6.0 documentation is available online at http://www.sqlite.org/draft/doc/pragma.html#pragma_temp_store http://www.sqlite.org/draft/doc/compile.html#temp_store Note that the name of the compile-time parameter is adding an "SQLITE_" prefix for consistency. Additional information about proposed changes that might impact projects can be found at: http://www.sqlite.org/draft/doc/35to36.html D. Richard Hipp [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users