On 2 Sep 2010, at 4:42am, Ben Danper wrote:

> On Wed, Sep 1, 2010 at 12:46 PM, Jay A. Kreibich <j...@...> wrote:
>> Maybe there would be some way to pre-populate the rollback journal
>> with the full contents of the original database. Then the file could
>> be truncated before the copy-back procedure. That would make it
>> clear to the OS that it is free to allocate whatever file blocks it
>> wants, hopefully in better patterns. The copy back could also be
>> done in very large chunks.
> 
> This is a fantastic idea! Not only truncate - since you know the new size, 
> you could also set the size beforehand before you start copying the pages 
> (similar to SQLITE_FCNTL_CHUNK_SIZE). Most filesystems will try very hard to 
> place it contiguously.

What does SQLite actually do if you take a table with a primary key and do this 
on it

INSERT OR REPLACE INTO myTable SELECT * FROM myTable

?  I assume that at some level it realises that no writing actually needs to be 
done.  But could you defeat that and have that statement just force a rewrite 
of the entire table ?

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

Reply via email to