On 07/23/2010 04:38 AM, Martin Engelschalk wrote: > Hello Taras, List, > > I have been fighting the same problems described here for a long time, > and have no real elegant solution. So, the proposed solution of the OP > below would be ideal for me too. > The proposed pragma could also define a number of pages to be allocated > at once instead of a number of bytes. > > In my case, the database grows continously and the file is often > extremely fragmented when the growth phase is finished (this concerns > the file on the disk, not internal fragmentation) > > Currently, i monitor the size of the database using pragma > freelist_count. When I see the value of free pages approach zero, i > create a dummy table with a blob field and fill it with a very large > empty blob. Then i drop the table. The empty pages remain behind and > page_count does not rise any more for a time. > This has been proposed to me on this list a while ago. > > However, testing the database in this way and creating and dropping the > table carries a performance penalty, and finding the strategic places in > my application to do this has been difficult.
Yeah sounds like the same problem. Interesting workaround. Here is my "fix". https://bugzilla.mozilla.org/show_bug.cgi?id=581606 This dramatically reduces fragmentation for append-only workloads. Taras _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users