I started to worry about this issue, because I am in a middle of an
application development, and yesterday, it started to work, and I only SELECT
a few times, and it makes a noticeable disk access. I'm still on magnetic HDD,
but the application will be running on SSD or Flash drive.

Let me start again by a stupid question. If I do a SELECT... does this
performs any disk write operation?

I know that sqlite can store the database in RAM. Is there any way to
(periodically) write the database to a regular sqlite file?

Does sqlite calls 'sync()' after an UPDATE or INSERT?

Thanks,
Levente

On Sat, 16 Aug 2014 22:22:56 +0100
Simon Slavin <slav...@bigfraud.org> wrote:

> A good question.  By which I mean it's one people should worry about,
> not one which we're not sure about.
> 
> No.  Physical writes to Flash drives are optimized for best use of
> hardware (minimum writes, promoting maximum lifetime for the device
> and fastest execution of programs).  Worse still, there is no
> guarantee that any writes are done to the device at all until you
> have issued 'unmount' to it (shown to the user as 'Eject' or 'Make
> safe for removal' on popular popular operating systems). Until then,
> as far as you're concerned, all the changes may be made only to a
> cache held by the device driver.
> 
> So if you pull your Flash drive without telling the OS to unmount it
> you can get all sorts of problems, including no files at all if they
> were created during that session.  It's rare to see this actually
> happen (few systems create a cache that reflects the whole drive then
> never bother to flush it) but the specs of the hardware involved do
> allow it.

-- 
Levente Kovacs
CTO, CSO
http://levente.logonex.eu



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to