On Wed, Feb 9, 2011 at 17:40, Ivan Zhakov <i...@visualsvn.com> wrote: > On Tue, Feb 8, 2011 at 12:50, Bert Huijben <b...@qqmail.nl> wrote: >>> -----Original Message----- >>> From: Branko Čibej [mailto:br...@xbc.nu] On Behalf Of Branko Cibej >>> Sent: dinsdag 8 februari 2011 4:39 >>> To: dev@subversion.apache.org >>> Subject: Re: SQLite and callbacks >>> >>> On 07.02.2011 21:51, Stefan Sperling wrote: >>> >> A lot of wc databases out there will be >>> >> so small that the user will hardly notice the memory increase. >>> > All we'd be doing is allowing sqlite to flush data to disk if needed. >>> > Even with a temporary table backed by a file, most operations happen >>> in >>> > memory. Either in buffers managed by sqlite or the operating system's >>> > buffer cache (until sqlite does an fsync). So for small databases it >>> > shouldn't make a difference. >> >> On NTFS just creating a new 0 byte tempfile requires an fsync (and probably >> a few in a row), > On Windows there is FILE_ATTRIBUTE_TEMPORARY [1] attribute, which > prevents file to be written to disk: > [[[ > Specifying the FILE_ATTRIBUTE_TEMPORARY attribute causes file systems > to avoid writing data back to mass storage if sufficient cache memory > is available, because an application deletes a temporary file after a > handle is closed. In that case, the system can entirely avoid writing > the data. Although it does not directly control data caching in the > same way as the previously mentioned flags, the > FILE_ATTRIBUTE_TEMPORARY attribute does tell the system to hold as > much as possible in the system cache without writing and therefore may > be of concern for certain applications. > ]]] > > May be we should submit a patch to SQLite to use this attribute? > > [1] http://msdn.microsoft.com/en-us/library/aa363858%28v=vs.85%29.aspx > > Well, I've checked SQLite source code and it seems SQLite uses FILE_ATTRIBUTE_TEMPORARY attribute when creating temporary database, database journal and other temporary files. So temporary tables backed up by file should be serious problem in theory.
-- Ivan Zhakov VisualSVN Team