D. Richard Hipp wrote:
> On Jul 1, 2008, at 11:03 AM, Martin.Engelschalk wrote:
> 
>> Hi all,
>>
>> i create and fill database files which reach quite a large size  
>> after a
>> while, because i only add data and never remove it.
>> The database files themselves become quite fragmented on the disk.
>> Because I can in many cases calculate in advance the size to which the
>> file will grow, i would like to reserve the disk space before  
>> inserting
>> all the data. Can this be done?
> 
> 
> Perhaps like this:
> 
>      CREATE TABLE dummy(x);
>      INSERT INTO dummy VALUES(zeroblob(10000000));
>      DROP TABLE dummy;
> 
> Change the argument of zeroblob to get the size you want.

Would something like this work (on linux)?

dd if=/dev/zero of=mydatabase.db bs=1024 count=65536

would create a file that is 64MB in size and zero it out. I'm not use 
how sqlite would react to being given a preallocated but empty file that 
exists.

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

Reply via email to